@@ -10,21 +10,21 @@ |
||
| 10 | 10 | class Permission extends Model |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - use SoftDeletes; |
|
| 14 | - protected $table = 'permissions'; |
|
| 15 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 16 | - protected $hidden = ['deleted_at']; |
|
| 17 | - protected $guarded = ['id']; |
|
| 18 | - public $fillable = ['name', 'model']; |
|
| 13 | + use SoftDeletes; |
|
| 14 | + protected $table = 'permissions'; |
|
| 15 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 16 | + protected $hidden = ['deleted_at']; |
|
| 17 | + protected $guarded = ['id']; |
|
| 18 | + public $fillable = ['name', 'model']; |
|
| 19 | 19 | |
| 20 | - public function roles() |
|
| 21 | - { |
|
| 22 | - return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
| 23 | - } |
|
| 20 | + public function roles() |
|
| 21 | + { |
|
| 22 | + return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public static function boot() |
|
| 26 | - { |
|
| 27 | - parent::boot(); |
|
| 28 | - Permission::observe(PermissionObserver::class); |
|
| 29 | - } |
|
| 25 | + public static function boot() |
|
| 26 | + { |
|
| 27 | + parent::boot(); |
|
| 28 | + Permission::observe(PermissionObserver::class); |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -5,41 +5,41 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Permissions extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('permissions', function (Blueprint $table) { |
|
| 16 | - increments('id'); |
|
| 17 | - $table->string('name', 100); |
|
| 18 | - $table->string('model', 100); |
|
| 19 | - $table->softDeletes(); |
|
| 20 | - $table->timestamps(); |
|
| 21 | - $table->unique(array('name', 'model')); |
|
| 22 | - }); |
|
| 23 | - Schema::create('permission_role', function (Blueprint $table) { |
|
| 24 | - increments('id'); |
|
| 25 | - $table->unsignedInteger('role_id'); |
|
| 26 | - $table->unsignedInteger('permission_id'); |
|
| 27 | - $table->softDeletes(); |
|
| 28 | - $table->timestamps(); |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('permissions', function (Blueprint $table) { |
|
| 16 | + increments('id'); |
|
| 17 | + $table->string('name', 100); |
|
| 18 | + $table->string('model', 100); |
|
| 19 | + $table->softDeletes(); |
|
| 20 | + $table->timestamps(); |
|
| 21 | + $table->unique(array('name', 'model')); |
|
| 22 | + }); |
|
| 23 | + Schema::create('permission_role', function (Blueprint $table) { |
|
| 24 | + increments('id'); |
|
| 25 | + $table->unsignedInteger('role_id'); |
|
| 26 | + $table->unsignedInteger('permission_id'); |
|
| 27 | + $table->softDeletes(); |
|
| 28 | + $table->timestamps(); |
|
| 29 | 29 | |
| 30 | - $table->foreign('role_id')->references('id')->on('roles'); |
|
| 31 | - $table->foreign('permission_id')->references('id')->on('permissions'); |
|
| 32 | - }); |
|
| 33 | - } |
|
| 30 | + $table->foreign('role_id')->references('id')->on('roles'); |
|
| 31 | + $table->foreign('permission_id')->references('id')->on('permissions'); |
|
| 32 | + }); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Reverse the migrations. |
|
| 37 | - * |
|
| 38 | - * @return void |
|
| 39 | - */ |
|
| 40 | - public function down() |
|
| 41 | - { |
|
| 42 | - Schema::dropIfExists('permission_role'); |
|
| 43 | - Schema::dropIfExists('permissions'); |
|
| 44 | - } |
|
| 35 | + /** |
|
| 36 | + * Reverse the migrations. |
|
| 37 | + * |
|
| 38 | + * @return void |
|
| 39 | + */ |
|
| 40 | + public function down() |
|
| 41 | + { |
|
| 42 | + Schema::dropIfExists('permission_role'); |
|
| 43 | + Schema::dropIfExists('permissions'); |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('permissions', function (Blueprint $table) { |
|
| 15 | + Schema::create('permissions', function(Blueprint $table) { |
|
| 16 | 16 | increments('id'); |
| 17 | 17 | $table->string('name', 100); |
| 18 | 18 | $table->string('model', 100); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | $table->unique(array('name', 'model')); |
| 22 | 22 | }); |
| 23 | - Schema::create('permission_role', function (Blueprint $table) { |
|
| 23 | + Schema::create('permission_role', function(Blueprint $table) { |
|
| 24 | 24 | increments('id'); |
| 25 | 25 | $table->unsignedInteger('role_id'); |
| 26 | 26 | $table->unsignedInteger('permission_id'); |
@@ -11,26 +11,26 @@ |
||
| 11 | 11 | class Role extends Model |
| 12 | 12 | { |
| 13 | 13 | |
| 14 | - use SoftDeletes; |
|
| 15 | - protected $table = 'roles'; |
|
| 16 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 17 | - protected $hidden = ['deleted_at']; |
|
| 18 | - protected $guarded = ['id']; |
|
| 19 | - public $fillable = ['name']; |
|
| 14 | + use SoftDeletes; |
|
| 15 | + protected $table = 'roles'; |
|
| 16 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 17 | + protected $hidden = ['deleted_at']; |
|
| 18 | + protected $guarded = ['id']; |
|
| 19 | + public $fillable = ['name']; |
|
| 20 | 20 | |
| 21 | - public function users() |
|
| 22 | - { |
|
| 23 | - return $this->belongsToMany(AclUser::class, 'role_user', 'role_id', 'user_id')->whereNull('role_user.deleted_at')->withTimestamps(); |
|
| 24 | - } |
|
| 21 | + public function users() |
|
| 22 | + { |
|
| 23 | + return $this->belongsToMany(AclUser::class, 'role_user', 'role_id', 'user_id')->whereNull('role_user.deleted_at')->withTimestamps(); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function permissions() |
|
| 27 | - { |
|
| 28 | - return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
| 29 | - } |
|
| 26 | + public function permissions() |
|
| 27 | + { |
|
| 28 | + return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id')->whereNull('permission_role.deleted_at')->withTimestamps(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - public static function boot() |
|
| 32 | - { |
|
| 33 | - parent::boot(); |
|
| 34 | - Role::observe(RoleObserver::class); |
|
| 35 | - } |
|
| 31 | + public static function boot() |
|
| 32 | + { |
|
| 33 | + parent::boot(); |
|
| 34 | + Role::observe(RoleObserver::class); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -5,40 +5,40 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Roles extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('roles', function (Blueprint $table) { |
|
| 16 | - increments('id'); |
|
| 17 | - $table->string('name', 100)->unique(); |
|
| 18 | - $table->softDeletes(); |
|
| 19 | - $table->timestamps(); |
|
| 20 | - }); |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('roles', function (Blueprint $table) { |
|
| 16 | + increments('id'); |
|
| 17 | + $table->string('name', 100)->unique(); |
|
| 18 | + $table->softDeletes(); |
|
| 19 | + $table->timestamps(); |
|
| 20 | + }); |
|
| 21 | 21 | |
| 22 | - Schema::create('role_user', function (Blueprint $table) { |
|
| 23 | - increments('id'); |
|
| 24 | - $table->unsignedInteger('user_id'); |
|
| 25 | - $table->unsignedInteger('role_id'); |
|
| 26 | - $table->softDeletes(); |
|
| 27 | - $table->timestamps(); |
|
| 22 | + Schema::create('role_user', function (Blueprint $table) { |
|
| 23 | + increments('id'); |
|
| 24 | + $table->unsignedInteger('user_id'); |
|
| 25 | + $table->unsignedInteger('role_id'); |
|
| 26 | + $table->softDeletes(); |
|
| 27 | + $table->timestamps(); |
|
| 28 | 28 | |
| 29 | - $table->foreign('user_id')->references('id')->on('users'); |
|
| 30 | - $table->foreign('role_id')->references('id')->on('roles'); |
|
| 31 | - }); |
|
| 32 | - } |
|
| 29 | + $table->foreign('user_id')->references('id')->on('users'); |
|
| 30 | + $table->foreign('role_id')->references('id')->on('roles'); |
|
| 31 | + }); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Reverse the migrations. |
|
| 36 | - * |
|
| 37 | - * @return void |
|
| 38 | - */ |
|
| 39 | - public function down() |
|
| 40 | - { |
|
| 41 | - Schema::dropIfExists('role_user'); |
|
| 42 | - Schema::dropIfExists('roles'); |
|
| 43 | - } |
|
| 34 | + /** |
|
| 35 | + * Reverse the migrations. |
|
| 36 | + * |
|
| 37 | + * @return void |
|
| 38 | + */ |
|
| 39 | + public function down() |
|
| 40 | + { |
|
| 41 | + Schema::dropIfExists('role_user'); |
|
| 42 | + Schema::dropIfExists('roles'); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -12,14 +12,14 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('roles', function (Blueprint $table) { |
|
| 15 | + Schema::create('roles', function(Blueprint $table) { |
|
| 16 | 16 | increments('id'); |
| 17 | 17 | $table->string('name', 100)->unique(); |
| 18 | 18 | $table->softDeletes(); |
| 19 | 19 | $table->timestamps(); |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | - Schema::create('role_user', function (Blueprint $table) { |
|
| 22 | + Schema::create('role_user', function(Blueprint $table) { |
|
| 23 | 23 | increments('id'); |
| 24 | 24 | $table->unsignedInteger('user_id'); |
| 25 | 25 | $table->unsignedInteger('role_id'); |
@@ -6,33 +6,33 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateJobsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('jobs', function (Blueprint $table) { |
|
| 17 | - $table->bigincrements('id')->primary(); |
|
| 18 | - $table->string('queue'); |
|
| 19 | - $table->longText('payload'); |
|
| 20 | - $table->tinyInteger('attempts')->unsigned(); |
|
| 21 | - $table->unsignedInteger('reserved_at')->nullable(); |
|
| 22 | - $table->unsignedInteger('available_at'); |
|
| 23 | - $table->unsignedInteger('created_at'); |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('jobs', function (Blueprint $table) { |
|
| 17 | + $table->bigincrements('id')->primary(); |
|
| 18 | + $table->string('queue'); |
|
| 19 | + $table->longText('payload'); |
|
| 20 | + $table->tinyInteger('attempts')->unsigned(); |
|
| 21 | + $table->unsignedInteger('reserved_at')->nullable(); |
|
| 22 | + $table->unsignedInteger('available_at'); |
|
| 23 | + $table->unsignedInteger('created_at'); |
|
| 24 | 24 | |
| 25 | - $table->index(['queue', 'reserved_at']); |
|
| 26 | - }); |
|
| 27 | - } |
|
| 25 | + $table->index(['queue', 'reserved_at']); |
|
| 26 | + }); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Reverse the migrations. |
|
| 31 | - * |
|
| 32 | - * @return void |
|
| 33 | - */ |
|
| 34 | - public function down() |
|
| 35 | - { |
|
| 36 | - Schema::dropIfExists('jobs'); |
|
| 37 | - } |
|
| 29 | + /** |
|
| 30 | + * Reverse the migrations. |
|
| 31 | + * |
|
| 32 | + * @return void |
|
| 33 | + */ |
|
| 34 | + public function down() |
|
| 35 | + { |
|
| 36 | + Schema::dropIfExists('jobs'); |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('jobs', function (Blueprint $table) { |
|
| 16 | + Schema::create('jobs', function(Blueprint $table) { |
|
| 17 | 17 | $table->bigincrements('id')->primary(); |
| 18 | 18 | $table->string('queue'); |
| 19 | 19 | $table->longText('payload'); |
@@ -6,30 +6,30 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateFailedJobsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
| 17 | - $table->bigincrements('id')->primary(); |
|
| 18 | - $table->text('connection'); |
|
| 19 | - $table->text('queue'); |
|
| 20 | - $table->longText('payload'); |
|
| 21 | - $table->longText('exception'); |
|
| 22 | - $table->timestamp('failed_at')->useCurrent(); |
|
| 23 | - }); |
|
| 24 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('failed_jobs', function (Blueprint $table) { |
|
| 17 | + $table->bigincrements('id')->primary(); |
|
| 18 | + $table->text('connection'); |
|
| 19 | + $table->text('queue'); |
|
| 20 | + $table->longText('payload'); |
|
| 21 | + $table->longText('exception'); |
|
| 22 | + $table->timestamp('failed_at')->useCurrent(); |
|
| 23 | + }); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Reverse the migrations. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function down() |
|
| 32 | - { |
|
| 33 | - Schema::dropIfExists('failed_jobs'); |
|
| 34 | - } |
|
| 26 | + /** |
|
| 27 | + * Reverse the migrations. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function down() |
|
| 32 | + { |
|
| 33 | + Schema::dropIfExists('failed_jobs'); |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
| 16 | + Schema::create('failed_jobs', function(Blueprint $table) { |
|
| 17 | 17 | $table->bigincrements('id')->primary(); |
| 18 | 18 | $table->text('connection'); |
| 19 | 19 | $table->text('queue'); |
@@ -10,32 +10,32 @@ |
||
| 10 | 10 | class PushNotificationDevice extends Model |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - use SoftDeletes; |
|
| 14 | - protected $table = 'push_notification_devices'; |
|
| 15 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 16 | - protected $hidden = ['deleted_at', 'access_token']; |
|
| 17 | - protected $guarded = ['id']; |
|
| 18 | - public $fillable = ['device_token', 'user_id', 'access_token']; |
|
| 13 | + use SoftDeletes; |
|
| 14 | + protected $table = 'push_notification_devices'; |
|
| 15 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 16 | + protected $hidden = ['deleted_at', 'access_token']; |
|
| 17 | + protected $guarded = ['id']; |
|
| 18 | + public $fillable = ['device_token', 'user_id', 'access_token']; |
|
| 19 | 19 | |
| 20 | - public function user() |
|
| 21 | - { |
|
| 22 | - return $this->belongsTo(AclUser::class); |
|
| 23 | - } |
|
| 20 | + public function user() |
|
| 21 | + { |
|
| 22 | + return $this->belongsTo(AclUser::class); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Encrypt the access_token attribute before |
|
| 27 | - * saving it in the storage. |
|
| 28 | - * |
|
| 29 | - * @param string $value |
|
| 30 | - */ |
|
| 31 | - public function setLoginTokenAttribute($value) |
|
| 32 | - { |
|
| 33 | - $this->attributes['access_token'] = encrypt($value); |
|
| 34 | - } |
|
| 25 | + /** |
|
| 26 | + * Encrypt the access_token attribute before |
|
| 27 | + * saving it in the storage. |
|
| 28 | + * |
|
| 29 | + * @param string $value |
|
| 30 | + */ |
|
| 31 | + public function setLoginTokenAttribute($value) |
|
| 32 | + { |
|
| 33 | + $this->attributes['access_token'] = encrypt($value); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public static function boot() |
|
| 37 | - { |
|
| 38 | - parent::boot(); |
|
| 39 | - PushNotificationDevice::observe(PushNotificationDeviceObserver::class); |
|
| 40 | - } |
|
| 36 | + public static function boot() |
|
| 37 | + { |
|
| 38 | + parent::boot(); |
|
| 39 | + PushNotificationDevice::observe(PushNotificationDeviceObserver::class); |
|
| 40 | + } |
|
| 41 | 41 | } |
@@ -6,64 +6,64 @@ |
||
| 6 | 6 | |
| 7 | 7 | class PushNotificationDevicesTableSeeder extends Seeder |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the database seeds. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function run() |
|
| 15 | - { |
|
| 16 | - /** |
|
| 17 | - * Insert the permissions related to settings table. |
|
| 18 | - */ |
|
| 19 | - \DB::table('permissions')->insert( |
|
| 20 | - [ |
|
| 21 | - /** |
|
| 22 | - * pushNotificationDevices model permissions. |
|
| 23 | - */ |
|
| 24 | - [ |
|
| 25 | - 'name' => 'index', |
|
| 26 | - 'model' => 'pushNotificationDevice', |
|
| 27 | - 'created_at' => \DB::raw('NOW()'), |
|
| 28 | - 'updated_at' => \DB::raw('NOW()') |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'show', |
|
| 32 | - 'model' => 'pushNotificationDevice', |
|
| 33 | - 'created_at' => \DB::raw('NOW()'), |
|
| 34 | - 'updated_at' => \DB::raw('NOW()') |
|
| 35 | - ], |
|
| 36 | - [ |
|
| 37 | - 'name' => 'store', |
|
| 38 | - 'model' => 'pushNotificationDevice', |
|
| 39 | - 'created_at' => \DB::raw('NOW()'), |
|
| 40 | - 'updated_at' => \DB::raw('NOW()') |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - 'name' => 'update', |
|
| 44 | - 'model' => 'pushNotificationDevice', |
|
| 45 | - 'created_at' => \DB::raw('NOW()'), |
|
| 46 | - 'updated_at' => \DB::raw('NOW()') |
|
| 47 | - ], |
|
| 48 | - [ |
|
| 49 | - 'name' => 'destroy', |
|
| 50 | - 'model' => 'pushNotificationDevice', |
|
| 51 | - 'created_at' => \DB::raw('NOW()'), |
|
| 52 | - 'updated_at' => \DB::raw('NOW()') |
|
| 53 | - ], |
|
| 54 | - [ |
|
| 55 | - 'name' => 'deleted', |
|
| 56 | - 'model' => 'pushNotificationDevice', |
|
| 57 | - 'created_at' => \DB::raw('NOW()'), |
|
| 58 | - 'updated_at' => \DB::raw('NOW()') |
|
| 59 | - ], |
|
| 60 | - [ |
|
| 61 | - 'name' => 'restore', |
|
| 62 | - 'model' => 'pushNotificationDevice', |
|
| 63 | - 'created_at' => \DB::raw('NOW()'), |
|
| 64 | - 'updated_at' => \DB::raw('NOW()') |
|
| 65 | - ] |
|
| 66 | - ] |
|
| 67 | - ); |
|
| 68 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + /** |
|
| 17 | + * Insert the permissions related to settings table. |
|
| 18 | + */ |
|
| 19 | + \DB::table('permissions')->insert( |
|
| 20 | + [ |
|
| 21 | + /** |
|
| 22 | + * pushNotificationDevices model permissions. |
|
| 23 | + */ |
|
| 24 | + [ |
|
| 25 | + 'name' => 'index', |
|
| 26 | + 'model' => 'pushNotificationDevice', |
|
| 27 | + 'created_at' => \DB::raw('NOW()'), |
|
| 28 | + 'updated_at' => \DB::raw('NOW()') |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'show', |
|
| 32 | + 'model' => 'pushNotificationDevice', |
|
| 33 | + 'created_at' => \DB::raw('NOW()'), |
|
| 34 | + 'updated_at' => \DB::raw('NOW()') |
|
| 35 | + ], |
|
| 36 | + [ |
|
| 37 | + 'name' => 'store', |
|
| 38 | + 'model' => 'pushNotificationDevice', |
|
| 39 | + 'created_at' => \DB::raw('NOW()'), |
|
| 40 | + 'updated_at' => \DB::raw('NOW()') |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + 'name' => 'update', |
|
| 44 | + 'model' => 'pushNotificationDevice', |
|
| 45 | + 'created_at' => \DB::raw('NOW()'), |
|
| 46 | + 'updated_at' => \DB::raw('NOW()') |
|
| 47 | + ], |
|
| 48 | + [ |
|
| 49 | + 'name' => 'destroy', |
|
| 50 | + 'model' => 'pushNotificationDevice', |
|
| 51 | + 'created_at' => \DB::raw('NOW()'), |
|
| 52 | + 'updated_at' => \DB::raw('NOW()') |
|
| 53 | + ], |
|
| 54 | + [ |
|
| 55 | + 'name' => 'deleted', |
|
| 56 | + 'model' => 'pushNotificationDevice', |
|
| 57 | + 'created_at' => \DB::raw('NOW()'), |
|
| 58 | + 'updated_at' => \DB::raw('NOW()') |
|
| 59 | + ], |
|
| 60 | + [ |
|
| 61 | + 'name' => 'restore', |
|
| 62 | + 'model' => 'pushNotificationDevice', |
|
| 63 | + 'created_at' => \DB::raw('NOW()'), |
|
| 64 | + 'updated_at' => \DB::raw('NOW()') |
|
| 65 | + ] |
|
| 66 | + ] |
|
| 67 | + ); |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -5,33 +5,33 @@ |
||
| 5 | 5 | |
| 6 | 6 | class PushNotificationDevices extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('push_notification_devices', function (Blueprint $table) { |
|
| 16 | - increments('id'); |
|
| 17 | - $table->string('device_token'); |
|
| 18 | - $table->unsignedInteger('user_id'); |
|
| 19 | - $table->text('access_token')->nullable(); |
|
| 20 | - $table->unique(array('device_token', 'user_id')); |
|
| 21 | - $table->softDeletes(); |
|
| 22 | - $table->timestamps(); |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('push_notification_devices', function (Blueprint $table) { |
|
| 16 | + increments('id'); |
|
| 17 | + $table->string('device_token'); |
|
| 18 | + $table->unsignedInteger('user_id'); |
|
| 19 | + $table->text('access_token')->nullable(); |
|
| 20 | + $table->unique(array('device_token', 'user_id')); |
|
| 21 | + $table->softDeletes(); |
|
| 22 | + $table->timestamps(); |
|
| 23 | 23 | |
| 24 | - $table->foreign('user_id')->references('id')->on('users'); |
|
| 25 | - }); |
|
| 26 | - } |
|
| 24 | + $table->foreign('user_id')->references('id')->on('users'); |
|
| 25 | + }); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Reverse the migrations. |
|
| 30 | - * |
|
| 31 | - * @return void |
|
| 32 | - */ |
|
| 33 | - public function down() |
|
| 34 | - { |
|
| 35 | - Schema::dropIfExists('push_notification_devices'); |
|
| 36 | - } |
|
| 28 | + /** |
|
| 29 | + * Reverse the migrations. |
|
| 30 | + * |
|
| 31 | + * @return void |
|
| 32 | + */ |
|
| 33 | + public function down() |
|
| 34 | + { |
|
| 35 | + Schema::dropIfExists('push_notification_devices'); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('push_notification_devices', function (Blueprint $table) { |
|
| 15 | + Schema::create('push_notification_devices', function(Blueprint $table) { |
|
| 16 | 16 | increments('id'); |
| 17 | 17 | $table->string('device_token'); |
| 18 | 18 | $table->unsignedInteger('user_id'); |