first commit

This commit is contained in:
Doar Mihai
2026-08-08 18:03:29 +03:00
commit df2128ebff
183 changed files with 18719 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace Database\Factories;
use App\Models\Tool;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends Factory<Tool>
*/
class ToolFactory extends Factory
{
/**
* @return array<string, mixed>
*/
public function definition(): array
{
$name = fake()->unique()->company();
$categories = array_keys(config('tools.categories'));
return [
'name' => $name,
'slug' => Str::slug($name),
'description' => fake()->paragraph(),
'url' => fake()->url(),
'logo_url' => 'https://picsum.photos/seed/'.Str::slug($name).'/200',
'category' => fake()->randomElement($categories),
'subcategory' => fake()->randomElement(['Code Assistants', 'Image Generation', 'Chatbots', 'Automation', null]),
'tags' => fake()->randomElements(['free', 'api', 'open-source', 'freemium', 'chrome-extension'], rand(1, 3)),
'pricing' => fake()->randomElement(['Free', 'Freemium', '$10/month', '$29/month', 'Contact for pricing']),
'features' => fake()->sentences(3),
'views' => fake()->numberBetween(0, 5000),
'clicks' => fake()->numberBetween(0, 500),
'featured' => false,
'approved' => true,
];
}
public function featured(): static
{
return $this->state(fn () => ['featured' => true]);
}
public function pending(): static
{
return $this->state(fn () => ['approved' => false]);
}
}