refactor(models): replace HasFactory with HasContainerFactory across all models
Add static $factory property for Porto-style model factory resolution
This commit is contained in:
@@ -5,13 +5,15 @@ namespace App\Containers\AdditionalEducation\Models;
|
||||
use App\Ship\Enums\Education\FormEducation;
|
||||
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 AdditionalEducation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\AdditionalEducationFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
namespace App\Containers\AdditionalEducation\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class AdditionalEducationCategory extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\AdditionalEducationCategoryFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
namespace App\Containers\AdditionalEducation\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class DirectionAdditionalEducation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\DirectionAdditionalEducationFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
namespace App\Containers\Article\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\CategoryFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use App\Containers\Article\Enums\PostStatus;
|
||||
use App\Containers\User\Models\User;
|
||||
use App\Containers\Widget\Models\Slide;
|
||||
use App\Ship\Traits\HasSeo;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
@@ -14,7 +14,9 @@ use Spatie\Tags\HasTags;
|
||||
|
||||
class Post extends Model
|
||||
{
|
||||
use HasFactory, HasTags, HasSeo;
|
||||
use HasContainerFactory, HasTags, HasSeo;
|
||||
|
||||
protected static string $factory = \Database\Factories\PostFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,9 +3,16 @@
|
||||
namespace App\Containers\Article\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\TagFactory::class;
|
||||
|
||||
protected $casts = [
|
||||
'name' => 'array',
|
||||
'slug' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
|
||||
namespace App\Containers\Dashboard\Models;
|
||||
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IntegrationCredential extends Model
|
||||
{
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\IntegrationCredentialFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
namespace App\Containers\Education\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
|
||||
class AdmissionCampaign extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\AdmissionCampaignFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
namespace App\Containers\Education\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AdmissionPlan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\AdmissionPlanFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -5,13 +5,15 @@ namespace App\Containers\Education\Models;
|
||||
use App\Ship\Enums\Education\LevelEducational;
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
|
||||
class DirectionStudy extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\DirectionStudyFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -6,14 +6,16 @@ use App\Containers\InstituteStructure\Models\Department;
|
||||
use App\Ship\Enums\Education\LevelEducational;
|
||||
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 Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class EducationalProgram extends Model
|
||||
{
|
||||
use HasFactory, HasSeo;
|
||||
use HasContainerFactory, HasSeo;
|
||||
|
||||
protected static string $factory = \Database\Factories\EducationalProgramFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -6,13 +6,15 @@ use App\Containers\Education\Models\EducationalProgram;
|
||||
use App\Containers\User\Models\User;
|
||||
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 Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Department extends Model
|
||||
{
|
||||
use HasFactory, HasSeo;
|
||||
use HasContainerFactory, HasSeo;
|
||||
|
||||
protected static string $factory = \Database\Factories\DepartmentFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -6,11 +6,13 @@ use App\Containers\User\Models\User;
|
||||
use App\Ship\Contracts\SeoDescriptionInterface;
|
||||
use App\Ship\Models\Model;
|
||||
use App\Ship\Traits\HasSeo;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
|
||||
class Division extends Model implements SeoDescriptionInterface
|
||||
{
|
||||
use HasFactory, HasSeo;
|
||||
use HasContainerFactory, HasSeo;
|
||||
|
||||
protected static string $factory = \Database\Factories\DivisionFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ namespace App\Containers\Schedule\Models;
|
||||
|
||||
use App\Containers\InstituteStructure\Models\Faculty;
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
|
||||
class EducationalGroup extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\EducationalGroupFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ namespace App\Containers\Schedule\Models;
|
||||
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
|
||||
class Schedule extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\ScheduleFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -5,12 +5,14 @@ namespace App\Containers\Science\Models;
|
||||
use App\Ship\Contracts\SeoDescriptionInterface;
|
||||
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\HasMany;
|
||||
|
||||
class AcademicJournal extends Model implements SeoDescriptionInterface
|
||||
{
|
||||
use HasFactory, HasSeo;
|
||||
use HasContainerFactory, HasSeo;
|
||||
|
||||
protected static string $factory = \Database\Factories\AcademicJournalFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
namespace App\Containers\Science\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
|
||||
class JournalIssue extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\JournalIssueFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
namespace App\Containers\User\Models;
|
||||
|
||||
use App\Ship\Models\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
|
||||
class UserDetail extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\UserDetailFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Containers\Widget\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ContactWidget extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\ContactWidgetFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
namespace App\Containers\Widget\Models;
|
||||
|
||||
use App\Containers\Widget\Enums\CustomFormStatus;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class CustomForm extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\CustomFormFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Containers\Widget\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CustomFormResponse extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\CustomFormResponseFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Containers\Widget\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PageReferenceList extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\PageReferenceListFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
namespace App\Containers\Widget\Models;
|
||||
|
||||
use App\Containers\Widget\Data\Factories\SlideFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Slide extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \App\Containers\Widget\Data\Factories\SlideFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
namespace App\Containers\Widget\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Ship\Traits\HasContainerFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Slider extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasContainerFactory;
|
||||
|
||||
protected static string $factory = \Database\Factories\SliderFactory::class;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user