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