refactor(models): replace HasFactory with HasContainerFactory across all models
Add static $factory property for Porto-style model factory resolution
This commit is contained in:
@@ -4,13 +4,15 @@ namespace App\Containers\Event\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use App\Ship\Traits\HasSeo;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\Tags\HasTags;
|
||||
|
||||
class Event extends Model
|
||||
{
|
||||
use HasFactory, HasTags, HasSeo;
|
||||
use HasContainerFactory, HasTags, HasSeo;
|
||||
|
||||
protected static string $factory = \Database\Factories\EventFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
namespace App\Containers\Event\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class EventCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\EventCategoryFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user