@@ -6,15 +6,15 @@ |
||
6 | 6 | |
7 | 7 | class ClearDataSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | - \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | - $permissions->delete(); |
|
19 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | + \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | + $permissions->delete(); |
|
19 | + } |
|
20 | 20 | } |
@@ -9,39 +9,39 @@ |
||
9 | 9 | |
10 | 10 | class ConfirmEmail extends Notification implements ShouldQueue |
11 | 11 | { |
12 | - use Queueable; |
|
12 | + use Queueable; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Create a new notification instance. |
|
16 | - */ |
|
17 | - public function __construct() |
|
18 | - { |
|
19 | - // |
|
20 | - } |
|
14 | + /** |
|
15 | + * Create a new notification instance. |
|
16 | + */ |
|
17 | + public function __construct() |
|
18 | + { |
|
19 | + // |
|
20 | + } |
|
21 | 21 | |
22 | - /** |
|
23 | - * Get the notification's delivery channels. |
|
24 | - * |
|
25 | - * @param mixed $notifiable |
|
26 | - * @return string[] |
|
27 | - */ |
|
28 | - public function via($notifiable) |
|
29 | - { |
|
30 | - return ['mail']; |
|
31 | - } |
|
22 | + /** |
|
23 | + * Get the notification's delivery channels. |
|
24 | + * |
|
25 | + * @param mixed $notifiable |
|
26 | + * @return string[] |
|
27 | + */ |
|
28 | + public function via($notifiable) |
|
29 | + { |
|
30 | + return ['mail']; |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * Get the mail representation of the notification. |
|
35 | - * |
|
36 | - * @param mixed $notifiable |
|
37 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
38 | - */ |
|
39 | - public function toMail($notifiable) |
|
40 | - { |
|
41 | - return (new MailMessage) |
|
42 | - ->subject('Email verification') |
|
43 | - ->line('Email verification') |
|
44 | - ->line('To validate your email click on the button below') |
|
45 | - ->action('Verify your email', config('skeleton.confrim_email_url').'/'.$notifiable->confirmation_code); |
|
46 | - } |
|
33 | + /** |
|
34 | + * Get the mail representation of the notification. |
|
35 | + * |
|
36 | + * @param mixed $notifiable |
|
37 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
38 | + */ |
|
39 | + public function toMail($notifiable) |
|
40 | + { |
|
41 | + return (new MailMessage) |
|
42 | + ->subject('Email verification') |
|
43 | + ->line('Email verification') |
|
44 | + ->line('To validate your email click on the button below') |
|
45 | + ->action('Verify your email', config('skeleton.confrim_email_url').'/'.$notifiable->confirmation_code); |
|
46 | + } |
|
47 | 47 | } |
@@ -9,41 +9,41 @@ |
||
9 | 9 | |
10 | 10 | class ResetPassword extends Notification implements ShouldQueue |
11 | 11 | { |
12 | - use Queueable; |
|
12 | + use Queueable; |
|
13 | 13 | |
14 | - protected $token; |
|
14 | + protected $token; |
|
15 | 15 | |
16 | - /** |
|
17 | - * Create a new notification instance. |
|
18 | - */ |
|
19 | - public function __construct($token) |
|
20 | - { |
|
21 | - $this->token = $token; |
|
22 | - } |
|
16 | + /** |
|
17 | + * Create a new notification instance. |
|
18 | + */ |
|
19 | + public function __construct($token) |
|
20 | + { |
|
21 | + $this->token = $token; |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * Get the notification's delivery channels. |
|
26 | - * |
|
27 | - * @param mixed $notifiable |
|
28 | - * @return string[] |
|
29 | - */ |
|
30 | - public function via($notifiable) |
|
31 | - { |
|
32 | - return ['mail']; |
|
33 | - } |
|
24 | + /** |
|
25 | + * Get the notification's delivery channels. |
|
26 | + * |
|
27 | + * @param mixed $notifiable |
|
28 | + * @return string[] |
|
29 | + */ |
|
30 | + public function via($notifiable) |
|
31 | + { |
|
32 | + return ['mail']; |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Get the mail representation of the notification. |
|
37 | - * |
|
38 | - * @param mixed $notifiable |
|
39 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
40 | - */ |
|
41 | - public function toMail($notifiable) |
|
42 | - { |
|
43 | - return (new MailMessage) |
|
44 | - ->subject('Reset passowrd') |
|
45 | - ->line('Reset passowrd') |
|
46 | - ->line('To reset your password click on the button below') |
|
47 | - ->action('Reset password', config('skeleton.reset_password_url').'/'.$this->token); |
|
48 | - } |
|
35 | + /** |
|
36 | + * Get the mail representation of the notification. |
|
37 | + * |
|
38 | + * @param mixed $notifiable |
|
39 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
40 | + */ |
|
41 | + public function toMail($notifiable) |
|
42 | + { |
|
43 | + return (new MailMessage) |
|
44 | + ->subject('Reset passowrd') |
|
45 | + ->line('Reset passowrd') |
|
46 | + ->line('To reset your password click on the button below') |
|
47 | + ->action('Reset password', config('skeleton.reset_password_url').'/'.$this->token); |
|
48 | + } |
|
49 | 49 | } |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your notification messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your notification messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notification'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notification'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notification'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notification'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -4,65 +4,65 @@ |
||
4 | 4 | |
5 | 5 | class MakeNotificationsCommand extends GeneratorCommand |
6 | 6 | { |
7 | - /** |
|
8 | - * The name and signature of the console command. |
|
9 | - * |
|
10 | - * @var string |
|
11 | - */ |
|
12 | - protected $signature = 'make:module:notification |
|
7 | + /** |
|
8 | + * The name and signature of the console command. |
|
9 | + * |
|
10 | + * @var string |
|
11 | + */ |
|
12 | + protected $signature = 'make:module:notification |
|
13 | 13 | {name : The name of the notification class.}'; |
14 | - /** |
|
15 | - * The console command description. |
|
16 | - * |
|
17 | - * @var string |
|
18 | - */ |
|
19 | - protected $description = 'Create a new module notification class'; |
|
20 | - /** |
|
21 | - * String to store the command type. |
|
22 | - * |
|
23 | - * @var string |
|
24 | - */ |
|
25 | - protected $type = 'Module notification'; |
|
26 | - /** |
|
27 | - * Get the stub file for the generator. |
|
28 | - * |
|
29 | - * @return string |
|
30 | - */ |
|
31 | - protected function getStub() |
|
32 | - { |
|
33 | - return __DIR__.'/stubs/notification.stub'; |
|
34 | - } |
|
35 | - /** |
|
36 | - * Get the destination class path. |
|
37 | - * |
|
38 | - * @param string $name |
|
39 | - * |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - protected function getPath($name) |
|
43 | - { |
|
44 | - return module_path('notifications', 'Notifications/'.$name.'.php'); |
|
45 | - } |
|
46 | - /** |
|
47 | - * Parse the name and format according to the root namespace. |
|
48 | - * |
|
49 | - * @param string $name |
|
50 | - * |
|
51 | - * @return string |
|
52 | - */ |
|
53 | - protected function qualifyClass($name) |
|
54 | - { |
|
55 | - return $name; |
|
56 | - } |
|
57 | - /** |
|
58 | - * Replace namespace in notification stub. |
|
59 | - * |
|
60 | - * @param string $name |
|
61 | - * |
|
62 | - * @return string |
|
63 | - */ |
|
64 | - protected function getNamespace($name) |
|
65 | - { |
|
66 | - return module_class('notifications', 'Notifications'); |
|
67 | - } |
|
14 | + /** |
|
15 | + * The console command description. |
|
16 | + * |
|
17 | + * @var string |
|
18 | + */ |
|
19 | + protected $description = 'Create a new module notification class'; |
|
20 | + /** |
|
21 | + * String to store the command type. |
|
22 | + * |
|
23 | + * @var string |
|
24 | + */ |
|
25 | + protected $type = 'Module notification'; |
|
26 | + /** |
|
27 | + * Get the stub file for the generator. |
|
28 | + * |
|
29 | + * @return string |
|
30 | + */ |
|
31 | + protected function getStub() |
|
32 | + { |
|
33 | + return __DIR__.'/stubs/notification.stub'; |
|
34 | + } |
|
35 | + /** |
|
36 | + * Get the destination class path. |
|
37 | + * |
|
38 | + * @param string $name |
|
39 | + * |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + protected function getPath($name) |
|
43 | + { |
|
44 | + return module_path('notifications', 'Notifications/'.$name.'.php'); |
|
45 | + } |
|
46 | + /** |
|
47 | + * Parse the name and format according to the root namespace. |
|
48 | + * |
|
49 | + * @param string $name |
|
50 | + * |
|
51 | + * @return string |
|
52 | + */ |
|
53 | + protected function qualifyClass($name) |
|
54 | + { |
|
55 | + return $name; |
|
56 | + } |
|
57 | + /** |
|
58 | + * Replace namespace in notification stub. |
|
59 | + * |
|
60 | + * @param string $name |
|
61 | + * |
|
62 | + * @return string |
|
63 | + */ |
|
64 | + protected function getNamespace($name) |
|
65 | + { |
|
66 | + return module_class('notifications', 'Notifications'); |
|
67 | + } |
|
68 | 68 | } |
@@ -6,48 +6,48 @@ |
||
6 | 6 | class PushNotificationDevice extends Model |
7 | 7 | { |
8 | 8 | |
9 | - use SoftDeletes; |
|
10 | - protected $table = 'push_notifications_devices'; |
|
11 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
12 | - protected $hidden = ['deleted_at', 'access_token']; |
|
13 | - protected $guarded = ['id']; |
|
14 | - protected $fillable = ['device_token', 'user_id', 'access_token']; |
|
15 | - public $searchable = ['device_token']; |
|
16 | - |
|
17 | - public function getCreatedAtAttribute($value) |
|
18 | - { |
|
19 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
20 | - } |
|
21 | - |
|
22 | - public function getUpdatedAtAttribute($value) |
|
23 | - { |
|
24 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
25 | - } |
|
26 | - |
|
27 | - public function getDeletedAtAttribute($value) |
|
28 | - { |
|
29 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
30 | - } |
|
9 | + use SoftDeletes; |
|
10 | + protected $table = 'push_notifications_devices'; |
|
11 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
12 | + protected $hidden = ['deleted_at', 'access_token']; |
|
13 | + protected $guarded = ['id']; |
|
14 | + protected $fillable = ['device_token', 'user_id', 'access_token']; |
|
15 | + public $searchable = ['device_token']; |
|
16 | + |
|
17 | + public function getCreatedAtAttribute($value) |
|
18 | + { |
|
19 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
20 | + } |
|
21 | + |
|
22 | + public function getUpdatedAtAttribute($value) |
|
23 | + { |
|
24 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
25 | + } |
|
26 | + |
|
27 | + public function getDeletedAtAttribute($value) |
|
28 | + { |
|
29 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
30 | + } |
|
31 | 31 | |
32 | - public function user() |
|
33 | - { |
|
34 | - return $this->belongsTo('App\Modules\Acl\AclUser'); |
|
35 | - } |
|
36 | - |
|
37 | - /** |
|
38 | - * Encrypt the access_token attribute before |
|
39 | - * saving it in the storage. |
|
40 | - * |
|
41 | - * @param string $value |
|
42 | - */ |
|
43 | - public function setLoginTokenAttribute($value) |
|
44 | - { |
|
45 | - $this->attributes['access_token'] = encrypt($value); |
|
46 | - } |
|
47 | - |
|
48 | - public static function boot() |
|
49 | - { |
|
50 | - parent::boot(); |
|
51 | - PushNotificationDevice::observe(\App::make('App\Modules\Notifications\ModelObservers\PushNotificationDeviceObserver')); |
|
52 | - } |
|
32 | + public function user() |
|
33 | + { |
|
34 | + return $this->belongsTo('App\Modules\Acl\AclUser'); |
|
35 | + } |
|
36 | + |
|
37 | + /** |
|
38 | + * Encrypt the access_token attribute before |
|
39 | + * saving it in the storage. |
|
40 | + * |
|
41 | + * @param string $value |
|
42 | + */ |
|
43 | + public function setLoginTokenAttribute($value) |
|
44 | + { |
|
45 | + $this->attributes['access_token'] = encrypt($value); |
|
46 | + } |
|
47 | + |
|
48 | + public static function boot() |
|
49 | + { |
|
50 | + parent::boot(); |
|
51 | + PushNotificationDevice::observe(\App::make('App\Modules\Notifications\ModelObservers\PushNotificationDeviceObserver')); |
|
52 | + } |
|
53 | 53 | } |
@@ -6,53 +6,53 @@ |
||
6 | 6 | class PushNotificationDeviceObserver |
7 | 7 | { |
8 | 8 | |
9 | - public function saving($model) |
|
10 | - { |
|
11 | - // |
|
12 | - } |
|
13 | - |
|
14 | - public function saved($model) |
|
15 | - { |
|
16 | - // |
|
17 | - } |
|
18 | - |
|
19 | - public function creating($model) |
|
20 | - { |
|
21 | - // |
|
22 | - } |
|
23 | - |
|
24 | - public function created($model) |
|
25 | - { |
|
26 | - // |
|
27 | - } |
|
28 | - |
|
29 | - public function updating($model) |
|
30 | - { |
|
31 | - // |
|
32 | - } |
|
33 | - |
|
34 | - public function updated($model) |
|
35 | - { |
|
36 | - // |
|
37 | - } |
|
38 | - |
|
39 | - public function deleting($model) |
|
40 | - { |
|
41 | - // |
|
42 | - } |
|
43 | - |
|
44 | - public function deleted($model) |
|
45 | - { |
|
46 | - // |
|
47 | - } |
|
48 | - |
|
49 | - public function restoring($model) |
|
50 | - { |
|
51 | - // |
|
52 | - } |
|
53 | - |
|
54 | - public function restored($model) |
|
55 | - { |
|
56 | - // |
|
57 | - } |
|
9 | + public function saving($model) |
|
10 | + { |
|
11 | + // |
|
12 | + } |
|
13 | + |
|
14 | + public function saved($model) |
|
15 | + { |
|
16 | + // |
|
17 | + } |
|
18 | + |
|
19 | + public function creating($model) |
|
20 | + { |
|
21 | + // |
|
22 | + } |
|
23 | + |
|
24 | + public function created($model) |
|
25 | + { |
|
26 | + // |
|
27 | + } |
|
28 | + |
|
29 | + public function updating($model) |
|
30 | + { |
|
31 | + // |
|
32 | + } |
|
33 | + |
|
34 | + public function updated($model) |
|
35 | + { |
|
36 | + // |
|
37 | + } |
|
38 | + |
|
39 | + public function deleting($model) |
|
40 | + { |
|
41 | + // |
|
42 | + } |
|
43 | + |
|
44 | + public function deleted($model) |
|
45 | + { |
|
46 | + // |
|
47 | + } |
|
48 | + |
|
49 | + public function restoring($model) |
|
50 | + { |
|
51 | + // |
|
52 | + } |
|
53 | + |
|
54 | + public function restored($model) |
|
55 | + { |
|
56 | + // |
|
57 | + } |
|
58 | 58 | } |
@@ -6,53 +6,53 @@ |
||
6 | 6 | class NotificationObserver |
7 | 7 | { |
8 | 8 | |
9 | - public function saving($model) |
|
10 | - { |
|
11 | - // |
|
12 | - } |
|
13 | - |
|
14 | - public function saved($model) |
|
15 | - { |
|
16 | - // |
|
17 | - } |
|
18 | - |
|
19 | - public function creating($model) |
|
20 | - { |
|
21 | - // |
|
22 | - } |
|
23 | - |
|
24 | - public function created($model) |
|
25 | - { |
|
26 | - // |
|
27 | - } |
|
28 | - |
|
29 | - public function updating($model) |
|
30 | - { |
|
31 | - // |
|
32 | - } |
|
33 | - |
|
34 | - public function updated($model) |
|
35 | - { |
|
36 | - // |
|
37 | - } |
|
38 | - |
|
39 | - public function deleting($model) |
|
40 | - { |
|
41 | - // |
|
42 | - } |
|
43 | - |
|
44 | - public function deleted($model) |
|
45 | - { |
|
46 | - // |
|
47 | - } |
|
48 | - |
|
49 | - public function restoring($model) |
|
50 | - { |
|
51 | - // |
|
52 | - } |
|
53 | - |
|
54 | - public function restored($model) |
|
55 | - { |
|
56 | - // |
|
57 | - } |
|
9 | + public function saving($model) |
|
10 | + { |
|
11 | + // |
|
12 | + } |
|
13 | + |
|
14 | + public function saved($model) |
|
15 | + { |
|
16 | + // |
|
17 | + } |
|
18 | + |
|
19 | + public function creating($model) |
|
20 | + { |
|
21 | + // |
|
22 | + } |
|
23 | + |
|
24 | + public function created($model) |
|
25 | + { |
|
26 | + // |
|
27 | + } |
|
28 | + |
|
29 | + public function updating($model) |
|
30 | + { |
|
31 | + // |
|
32 | + } |
|
33 | + |
|
34 | + public function updated($model) |
|
35 | + { |
|
36 | + // |
|
37 | + } |
|
38 | + |
|
39 | + public function deleting($model) |
|
40 | + { |
|
41 | + // |
|
42 | + } |
|
43 | + |
|
44 | + public function deleted($model) |
|
45 | + { |
|
46 | + // |
|
47 | + } |
|
48 | + |
|
49 | + public function restoring($model) |
|
50 | + { |
|
51 | + // |
|
52 | + } |
|
53 | + |
|
54 | + public function restored($model) |
|
55 | + { |
|
56 | + // |
|
57 | + } |
|
58 | 58 | } |