#EXTM3U
#EXTINF:0,09 Implement JWT Token for Login Authentication
directory:///home/serii/Documents/Courses/%5BUdemy%5D%20Laravel%208%20Vuejs%20%26%20RESTful%20API%20Course%20With%20Complete%20Project%20%282021%29%20%5BEn%5D/09%20Implement%20JWT%20Token%20for%20Login%20Authentication
public function run()
{
$this->call(UserTableSeeder::class);
$this->call(BlogCategorySeeder::class);
$users = \App\User::all();
$result = [];
foreach ($users as $user) {
$result[] = $user->id;
}
dd($result);
factory(BlogPost::class, 1)->create();
}
Dropped all tables successfully.
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table (0.06 seconds)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table (0.06 seconds)
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated: 2019_08_19_000000_create_failed_jobs_table (0.04 seconds)
Migrating: 2022_01_08_112050_create_blog_categories_table
Migrated: 2022_01_08_112050_create_blog_categories_table (0.06 seconds)
Migrating: 2022_01_19_192927_create_jobs_table
Migrated: 2022_01_19_192927_create_jobs_table (0.06 seconds)
Migrating: 2022_01_21_220416_create_blog_posts_table
Migrated: 2022_01_21_220416_create_blog_posts_table (0.26 seconds)
Seeding: UserTableSeeder
Seeded: UserTableSeeder (0.16 seconds)
Seeding: BlogCategorySeeder
Seeded: BlogCategorySeeder (0 seconds)
array:2 [
0 => 1
1 => 2
]
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table (SQL: alter table `blog_posts` add constraint `blog_posts_user_id_foreign` foreign key (`user_id`) references `users` (`id`))
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {
> 671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|
+12 vendor frames
13 database/migrations/2022_01_08_112722_create_blog_posts_table.php:26
Illuminate\Support\Facades\Facade::__callStatic("create")
php artisan migrate
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'user_id' doesn't exist in table (SQL: alter table `blog_posts` add constraint `blog_posts_user_id_foreign` foreign key (`user_id`) references `users` (`id`))
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {
> 671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|
+12 vendor frames
13 database/migrations/2022_01_08_112722_create_blog_posts_table.php:26
Illuminate\Support\Facades\Facade::__callStatic("create")