Refactor helper functions and update seeders
- Simplified `tmpostChannel` and `tmpostDefaultInventory` functions by removing caching logic. - Changed return type of `namesWithTaxes` method in `CategoryRepository` to `mixed`. - Enabled `ProductsTableSeeder` and added user association logic for product relations. - Updated `BrandsSeeder` to include the product ID in the slug. - Added `old_customer_id` to `options` in `SellersTableSeeder` for user tracking.
This commit is contained in:
@@ -176,9 +176,7 @@ if (! function_exists('tmpostChannel')) {
|
||||
*/
|
||||
function tmpostChannel(): Channel
|
||||
{
|
||||
Cache::rememberForever('tmpostChannel', fn () => Channel::tmpostDefault());
|
||||
|
||||
return Cache::get('tmpostChannel');
|
||||
return Channel::tmpostDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,9 +186,7 @@ if (! function_exists('tmpostDefaultInventory')) {
|
||||
*/
|
||||
function tmpostDefaultInventory(): mixed
|
||||
{
|
||||
Cache::rememberForever('tmpostDefaultInventory', fn () => Inventory::tmpostDefault());
|
||||
|
||||
return Cache::get('tmpostDefaultInventory');
|
||||
return Inventory::tmpostDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class CategoryRepository
|
||||
/**
|
||||
* Names with taxes (usefull for nova)
|
||||
*/
|
||||
public static function namesWithTaxes(): array
|
||||
public static function namesWithTaxes(): mixed
|
||||
{
|
||||
return CacheRepository::make(
|
||||
time: 5,
|
||||
|
||||
Reference in New Issue
Block a user