When using traits with Eloquent models, Laravel has a neat trick thatbootsthe trait allowing us to hook into the Eloquent events. Laravel’s ownSoftDeletestraituses this bootable feature to add a global scope t
When using traits with Eloquent models, Laravel has a neat trick thatbootsthe trait allowing us to hook into the Eloquent events. Laravel’s ownSoftDeletestraituses this bootable feature to add a global scope that allows us to soft delete a model. To take a look at how we can use traits...
Hi, I have some trait that I want to use it in my models. here I have two traits that I want to use : the error is: a trait is not found. <?php namespace App\Models; use App\Models\Services\Permissions\Traits\HasPermissions; use App\Models\Services\Roles\Traits\HasRoles; use ...
This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop. - Rokasl/nova-sortable
This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop.Uses Spatie's eloquent-sortable under the hood.Requirementsphp: >=8.0 laravel/nova: ^4.6.0FeaturesDrag & drop reorder (on either Index view or HasMany view) BelongsTo/MorphsTo reorder...
However, the->where('status', LapTimeStatus::APPROVED)line is causing issues. It works perfectly fine for the first season, however for whatever reason this line returns 0 models for each round, despite all of them having at least one approved lap time. I've been able to fix it by cha...
When testing, there is always the question of what data to base tests on. In the context of browser tests, we may need it to check if the elements we show are displayed correctly. Laravel has a whole set of traits just for such needs. And ifRefreshDatabasecannot be used in browser te...
First, add the Maklad\Permission\Traits\HasRoles trait to your User model(s):use Illuminate\Auth\Authenticatable; use Jenssegers\Mongodb\Eloquent\Model as Model; use Illuminate\Foundation\Auth\Access\Authorizable; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\...
This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop.Uses Spatie's eloquent-sortable under the hood.Requirementsphp: >=7.3 laravel/nova: ^3.0FeaturesDrag & drop reorder (on either Index view or HasMany view) BelongsTo/MorphsTo reorder ...
This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop. - crynobone/nova-sortable