@@ -12,7 +12,7 @@ |
||
| 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 | 17 | $table->string('device_token'); |
| 18 | 18 | $table->integer('user_id'); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Notifications\Notification::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Notifications\Notification::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'type' => '', |
| 6 | 6 | 'notifiable_type' => '', |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Notifications\PushNotificationDevice::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Notifications\PushNotificationDevice::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'device_token' => $faker->sha1(), |
| 6 | 6 | 'user_id' => $faker->randomDigitNotNull(), |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use Illuminate\Notifications\DatabaseNotification; |
| 4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
| 5 | 5 | |
| 6 | -class Notification extends DatabaseNotification{ |
|
| 6 | +class Notification extends DatabaseNotification { |
|
| 7 | 7 | |
| 8 | 8 | public function getCreatedAtAttribute($value) |
| 9 | 9 | { |
@@ -12,7 +12,7 @@ discard block |
||
| 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 | * List of all route actions that the base api controller |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * to check before add. |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - protected $validationRules = [ |
|
| 29 | + protected $validationRules = [ |
|
| 30 | 30 | 'device_token' => 'required|string|max:255', |
| 31 | 31 | 'user_id' => 'required|exists:users,id' |
| 32 | 32 | ]; |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * to preform actions like (add, edit ... etc). |
| 13 | 13 | * @var string |
| 14 | 14 | */ |
| 15 | - protected $model = 'notifications'; |
|
| 15 | + protected $model = 'notifications'; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * List of all route actions that the base api controller |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $notificationBuilder = new PayloadNotificationBuilder($title); |
| 50 | 50 | $dataBuilder = new PayloadDataBuilder(); |
| 51 | 51 | |
| 52 | - $optionBuilder->setTimeToLive(60*20); |
|
| 52 | + $optionBuilder->setTimeToLive(60 * 20); |
|
| 53 | 53 | $notificationBuilder->setBody($message); |
| 54 | 54 | $dataBuilder->addData($data); |
| 55 | 55 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public function notify($users, $notification, $notificationData = false) |
| 72 | 72 | { |
| 73 | - $notification = 'App\Modules\Notifications\Notifications\\' . $notification; |
|
| 73 | + $notification = 'App\Modules\Notifications\Notifications\\'.$notification; |
|
| 74 | 74 | \Notification::send($users, new $notification($notificationData)); |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -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'; |