@loyd what is Database?
I read the doc..their is no database mentioned
Oct 14, 2020
2
Level 9
PHP Error: Class 'Database/Factories/BookingEventFactory' not found in C:/laragon/www/acl/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Factory.php
In my terminal using running the tinker cli. It send me this type of error. Can someone plz tell me what i did wrong. I am using the laravel 8.9.0 version.
Note: Basically I've upgraded my project form laravel 7 to laravel 8 and I've installed the legacy pkg for factroy.
λ php artisan tinker
Psy Shell v0.10.4 (PHP 7.4.8 — cli) by Justin Hileman
>>> use App\{User,BookingEvent,BookingService};
>>> BookingEvent::factory()->count(3)->for(BookingService::factory())->create();
PHP Error: Class 'Database/Factories/BookingEventFactory' not found in C:/laragon/www/acl/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Factories/Factory.php on line 656
This is my BookingEventFactory
<?php
namespace Database\Factories;
use App\BookingEvent;
use App\BookingService;
use Illuminate\Database\Eloquent\Factories\Factory;
class BookingEventFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = BookingEvent::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'event_name' => $this->faker->name,
'user_id' => 2,
'booking_service_id' => BookingService::factory(),
'duration' => '1 Hours',
'price' => '1000',
'event_description' => $this->faker->paragraph,
];
}
}
Level 9
Solution for this thread is in this link =>
Please or to participate in this conversation.