feat: product badges and show page layout
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
029689407b
commit
9920fafab6
@@ -45,3 +45,27 @@ function something()
|
||||
{
|
||||
// ..
|
||||
}
|
||||
|
||||
function userWithRole(string $slug): \App\Models\User
|
||||
{
|
||||
$role = \App\Models\Role::firstOrCreate(
|
||||
['slug' => $slug],
|
||||
['name' => ucfirst($slug), 'description' => ucfirst($slug)]
|
||||
);
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user->roles()->attach($role);
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
function makeCategory(): \App\Models\Category
|
||||
{
|
||||
$name = 'Category ' . \Illuminate\Support\Str::random(8);
|
||||
|
||||
return \App\Models\Category::create([
|
||||
'name' => $name,
|
||||
'slug' => \Illuminate\Support\Str::slug($name),
|
||||
'description' => 'Test description',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user