Skip to content

Commit

Permalink
proxy factory models
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Mar 18, 2024
1 parent 3cdc893 commit c6361c4
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 0 deletions.
10 changes: 10 additions & 0 deletions database/factories/CartFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ class CartFactory extends Factory
*/
protected $model = Cart::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/ItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ class ItemFactory extends Factory
*/
protected $model = Item::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/OrderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ class OrderFactory extends Factory
*/
protected $model = Order::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/ProductFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class ProductFactory extends Factory
*/
protected $model = Product::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/PropertyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ class PropertyFactory extends Factory
*/
protected $model = Property::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/PropertyValueFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ class PropertyValueFactory extends Factory
*/
protected $model = PropertyValue::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/ShippingFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ class ShippingFactory extends Factory
*/
protected $model = Shipping::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/TransactionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ class TransactionFactory extends Factory
*/
protected $model = Transaction::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down
10 changes: 10 additions & 0 deletions database/factories/VariantFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ class VariantFactory extends Factory
*/
protected $model = Variant::class;

/**
* Get the name of the model that is generated by the factory.
*
* @return class-string<\Illuminate\Database\Eloquent\Model|TModel>
*/
public function modelName(): string
{
return $this->model::getProxiedClass();
}

/**
* Define the model's default state.
*/
Expand Down

0 comments on commit c6361c4

Please sign in to comment.