Update UI and migration,seeder for notification.

This commit is contained in:
weiweitoo
2018-07-24 17:02:45 +08:00
parent 81bf3ac585
commit 563c0d42d7
6 changed files with 114 additions and 27 deletions
@@ -16,7 +16,9 @@ class CreateNotificationTable extends Migration
Schema::create('notifications', function (Blueprint $table) {
$table->increments('id');
$table->string('detail');
$table->string('link');
$table->unsignedInteger('user_id');
$table->boolean('is_read')->default(0);
$table->timestamps();
$table->foreign('user_id')
+2
View File
@@ -19,6 +19,7 @@ class NotificationSeeder extends Seeder
DB::table('notifications')->insert([
'detail' => 'This is an user seeder notification',
'user_id' => $user->id,
'link' => 'http://www.google.com',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
]);
@@ -26,6 +27,7 @@ class NotificationSeeder extends Seeder
DB::table('notifications')->insert([
'detail' => 'This is an admin seeder notification',
'user_id' => $admin->id,
'link' => 'http://www.google.com',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
]);