Category: laravel
-
Authorization using spatie role in filament v3
Define Permissions in the Policy Register the Policy in AuthServiceProvider 2. Authorizing access to the panel in App\Models\User 3. Authorizing access to the resource in app/Filament/Resources/UserResource 4. Authorizing access to the page in app/Filament/Resources/UserResource/ListUsers Global using in class
-
Filament file upload error docker, behind reverse proxy, and using a subdomain
commenting out abort_unless(request()->hasValidSignature(), 401); line.in \vendor\livewire\livewire\src\Features\SupportFileUploads\FileUploadController.php
-
Laravel ringlesoft / laravel-process-approval resubmit function
-
Laravel model relation parameter
Store table:store_id (PK) Library table:library_id (PK) library_fk_store_id (FK) Store model: Library model: `library_fk_store_id` `Store model -> library_id` `Library model -> store_id` `libraries() -> library_id` `store() -> store_id`
-
Laravel Trend query example
-
Convert filament or livewire component into html string in controller
-
Laravel pivot Eloquent – Attach vs. SyncWithoutDetaching
attach() will always add a new record to the pivot table, whereas syncWithoutDetaching() will only add a new record if one does not exist. sync(Array, false) is the same as syncWithoutDetaching(): In short, by default sync() detaches.
-
Create Laravel Faker
refer https://kinsta.com/blog/laravel-model-factories/ Create the TeamFactory File in \database\factories\TeamFactory.php Run the seeder
-
Laravel database migration schema to disable foreign id check
-
CRUD REST API passpord with Laravel API Resource
Next, open app/Providers/AuthServiceProvider.php file and register the registerPolicies() method inside the boot() function, It will evoke the required routes. Register the PassportServiceProvider class in providers array inside the config/app.php file: Configure driver for the Passport, get inside the config/auth.php file and make the changes as shown below. Create Controller Class and Resource Class Controller code…