@@ -159,7 +159,7 @@ |
||
| 159 | 159 | */ |
| 160 | 160 | public function down() |
| 161 | 161 | { |
| 162 | - $permissions = DB::table('permissions')->whereIn('model', ['settings']); |
|
| 162 | + $permissions = DB::table('permissions')->whereIn('model', ['settings']); |
|
| 163 | 163 | DB::table('groups_permissions')->whereIn('permission_id', $permissions->lists('id'))->delete(); |
| 164 | 164 | $permissions->delete(); |
| 165 | 165 | } |
@@ -12,14 +12,14 @@ |
||
| 12 | 12 | * to preform actions like (add, edit ... etc). |
| 13 | 13 | * @var string |
| 14 | 14 | */ |
| 15 | - protected $model = 'pushNotificationDevices'; |
|
| 15 | + protected $model = 'pushNotificationDevices'; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * The validations rules used by the base api controller |
| 19 | 19 | * to check before add. |
| 20 | 20 | * @var array |
| 21 | 21 | */ |
| 22 | - protected $validationRules = [ |
|
| 22 | + protected $validationRules = [ |
|
| 23 | 23 | 'device_token' => 'required|string|max:255', |
| 24 | 24 | 'device_type' => 'required|in:android,ios', |
| 25 | 25 | 'user_id' => 'required|exists:users,id', |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('push_notifications_devices', function (Blueprint $table) { |
|
| 15 | + Schema::create('push_notifications_devices', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | - $table->string('device_token',255); |
|
| 17 | + $table->string('device_token', 255); |
|
| 18 | 18 | $table->enum('device_type', ['android', 'ios']); |
| 19 | 19 | $table->integer('user_id'); |
| 20 | 20 | $table->boolean('active')->default(1); |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | */ |
| 165 | 165 | public function down() |
| 166 | 166 | { |
| 167 | - $permissions = DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
| 167 | + $permissions = DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
| 168 | 168 | DB::table('groups_permissions')->whereIn('permission_id', $permissions->lists('id'))->delete(); |
| 169 | 169 | $permissions->delete(); |
| 170 | 170 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use Illuminate\Database\Eloquent\Model; |
| 4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
| 5 | 5 | |
| 6 | -class PushNotificationDevice extends Model{ |
|
| 6 | +class PushNotificationDevice extends Model { |
|
| 7 | 7 | |
| 8 | 8 | use SoftDeletes; |
| 9 | 9 | protected $table = 'push_notifications_devices'; |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | */ |
| 102 | 102 | public function down() |
| 103 | 103 | { |
| 104 | - $permissions = DB::table('permissions')->whereIn('model', ['reports']); |
|
| 104 | + $permissions = DB::table('permissions')->whereIn('model', ['reports']); |
|
| 105 | 105 | DB::table('groups_permissions')->whereIn('permission_id', $permissions->lists('id'))->delete(); |
| 106 | 106 | $permissions->delete(); |
| 107 | 107 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | if (array_key_exists('ios', $devicesArray)) |
| 34 | 34 | { |
| 35 | - $message = $this->constructMessage($messageText, [ 'badge' => 15, 'sound' => 'default' ]); |
|
| 35 | + $message = $this->constructMessage($messageText, ['badge' => 15, 'sound' => 'default']); |
|
| 36 | 36 | $iosDevices = \PushNotification::DeviceCollection($devicesArray['ios']); |
| 37 | 37 | $this->push('ios', $iosDevices, $message); |
| 38 | 38 | } |