9 questions
1
vote
1
answer
83
views
When loading data with seeder in Laravel, it says there is no conversion from nvarchar data type to datetime data type
public function up(): void
{
Schema::create('books', function (Blueprint $table) {
$table->id();
$table->string('book_name');
$table->string('...
0
votes
3
answers
83
views
Running cleanup method before migrate:fresh to remove old images from storage
I would like to cleanup the locally seeded storage images when running php artisan migrate:fresh --seed.
I noticed that all the database tables get dropped before the seeders even start. So my method ...
0
votes
1
answer
260
views
Laravel 11 Invalid datetime format when seeding
Hie. I have not used seeders in a long time and in my Laravel project I just started I am getting an error. The below is the seeder class. The factory is working with no issues though.
<?php
...
0
votes
2
answers
70
views
Child table seeding for an incremental column in laravel
stores table (id, name)
store_opening_hours table (id, store_id, day_of_week, opens_at, closes_at)
StoreFactory.php file:
class StoreFactory extends Factory
{
public function definition(): array
...
0
votes
1
answer
89
views
Laravel 8 - How to use if else condition inside for loop in seeder file?
I'm new to Laravel. I've made a seeder file, and there is a for loop in it. I want to set the room_type based on the $i value, but it does not work.
This is the seeder file:
<?php
namespace ...