Skip to content

Instantly share code, notes, and snippets.

View greenspace10's full-sized avatar
🏠
Working from home

Nathan Robinson greenspace10

🏠
Working from home
View GitHub Profile
@greenspace10
greenspace10 / CreateBranch.php
Created March 21, 2022 08:39
Multipart form actions
<?php
namespace App\Actions;
use App\Models\Branch;
use Lorisleiva\Actions\ActionRequest;
class CreateBranch
{
public function handle($data)
@greenspace10
greenspace10 / AppServiceProvider.php
Created June 14, 2021 17:16
Laravel, Livewire, Alpine JS Toast Notifications
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Component::macro('notify', function ($message, $title = '', $type = 'success') {
$this->dispatchBrowserEvent('notify', ['message' => $message, 'title' => $title, 'type' => $type]);
});