Skip to content

Instantly share code, notes, and snippets.

import { reactive } from '@vue/reactivity'
function switchboard(value) {
let lookup = {}
let current
let get = () => current
let set = (newValue) => {
@wijourdil
wijourdil / test_mail.php
Last active January 12, 2024 11:11
Send a test mail / notification in Laravel from Tinker
<?php
/**
* Mail
*/
Mail::raw('hello world', function($message) { $message->to('myawesomeemail@domain.com')->subject('Testing mails'); });
/**
* Notification
*/
<?php
/**
* In your Livewire model for the list of items
*/
class ItemList extends Component
{
// rest of component
<?php
$spaces = [
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET')
];
<?php
namespace App\Charts;
use App\Support\Livewire\ChartComponentData;
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
/**
* Class WanSpeedTestsChart
*
@paulund
paulund / AppServiceProvider.php
Last active March 16, 2023 18:10
Laravel Cache Auth::user(). Learn how to cache the logged in user at https://paulund.co.uk/laravel-cache-authuser
<?php
namespace App\Providers;
use App\Models\User;
use App\Observers\UserObserver;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@jeffochoa
jeffochoa / Response.php
Last active March 15, 2024 14:55
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;