@@ -5,48 +5,48 @@ |
||
| 5 | 5 | |
| 6 | 6 | class PushNotificationDevice extends Model{ |
| 7 | 7 | |
| 8 | - use SoftDeletes; |
|
| 9 | - protected $table = 'push_notifications_devices'; |
|
| 10 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | - protected $hidden = ['deleted_at', 'access_token']; |
|
| 12 | - protected $guarded = ['id']; |
|
| 13 | - protected $fillable = ['device_token', 'user_id', 'access_token']; |
|
| 14 | - public $searchable = ['device_token']; |
|
| 15 | - |
|
| 16 | - public function getCreatedAtAttribute($value) |
|
| 17 | - { |
|
| 18 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - public function getUpdatedAtAttribute($value) |
|
| 22 | - { |
|
| 23 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function getDeletedAtAttribute($value) |
|
| 27 | - { |
|
| 28 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 29 | - } |
|
| 8 | + use SoftDeletes; |
|
| 9 | + protected $table = 'push_notifications_devices'; |
|
| 10 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | + protected $hidden = ['deleted_at', 'access_token']; |
|
| 12 | + protected $guarded = ['id']; |
|
| 13 | + protected $fillable = ['device_token', 'user_id', 'access_token']; |
|
| 14 | + public $searchable = ['device_token']; |
|
| 15 | + |
|
| 16 | + public function getCreatedAtAttribute($value) |
|
| 17 | + { |
|
| 18 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + public function getUpdatedAtAttribute($value) |
|
| 22 | + { |
|
| 23 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function getDeletedAtAttribute($value) |
|
| 27 | + { |
|
| 28 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - public function user() |
|
| 32 | - { |
|
| 33 | - return $this->belongsTo('App\Modules\Acl\AclUser'); |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - /** |
|
| 37 | - * Encrypt the access_token attribute before |
|
| 38 | - * saving it in the storage. |
|
| 39 | - * |
|
| 40 | - * @param string $value |
|
| 41 | - */ |
|
| 42 | - public function setLoginTokenAttribute($value) |
|
| 43 | - { |
|
| 44 | - $this->attributes['access_token'] = encrypt($value); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public static function boot() |
|
| 48 | - { |
|
| 49 | - parent::boot(); |
|
| 50 | - parent::observe(\App::make('App\Modules\Notifications\ModelObservers\PushNotificationDeviceObserver')); |
|
| 51 | - } |
|
| 31 | + public function user() |
|
| 32 | + { |
|
| 33 | + return $this->belongsTo('App\Modules\Acl\AclUser'); |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + /** |
|
| 37 | + * Encrypt the access_token attribute before |
|
| 38 | + * saving it in the storage. |
|
| 39 | + * |
|
| 40 | + * @param string $value |
|
| 41 | + */ |
|
| 42 | + public function setLoginTokenAttribute($value) |
|
| 43 | + { |
|
| 44 | + $this->attributes['access_token'] = encrypt($value); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + public static function boot() |
|
| 48 | + { |
|
| 49 | + parent::boot(); |
|
| 50 | + parent::observe(\App::make('App\Modules\Notifications\ModelObservers\PushNotificationDeviceObserver')); |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -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 | } |
| 69 | 69 | \ No newline at end of file |
@@ -6,23 +6,23 @@ |
||
| 6 | 6 | |
| 7 | 7 | class OauthClient extends Client |
| 8 | 8 | { |
| 9 | - protected $dates = ['created_at', 'updated_at']; |
|
| 10 | - protected $fillable = ['name', 'redirect', 'user_id', 'personal_access_client', 'password_client', 'revoked']; |
|
| 11 | - public $searchable = ['name']; |
|
| 9 | + protected $dates = ['created_at', 'updated_at']; |
|
| 10 | + protected $fillable = ['name', 'redirect', 'user_id', 'personal_access_client', 'password_client', 'revoked']; |
|
| 11 | + public $searchable = ['name']; |
|
| 12 | 12 | |
| 13 | - public function getCreatedAtAttribute($value) |
|
| 14 | - { |
|
| 15 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 16 | - } |
|
| 13 | + public function getCreatedAtAttribute($value) |
|
| 14 | + { |
|
| 15 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - public function getUpdatedAtAttribute($value) |
|
| 19 | - { |
|
| 20 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 21 | - } |
|
| 18 | + public function getUpdatedAtAttribute($value) |
|
| 19 | + { |
|
| 20 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public static function boot() |
|
| 24 | - { |
|
| 25 | - parent::boot(); |
|
| 26 | - parent::observe(\App::make('App\Modules\Acl\ModelObservers\OauthClientObserver')); |
|
| 27 | - } |
|
| 23 | + public static function boot() |
|
| 24 | + { |
|
| 25 | + parent::boot(); |
|
| 26 | + parent::observe(\App::make('App\Modules\Acl\ModelObservers\OauthClientObserver')); |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -8,72 +8,72 @@ |
||
| 8 | 8 | class RouteServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * This namespace is applied to your controller routes. |
|
| 12 | - * |
|
| 13 | - * In addition, it is set as the URL generator's root namespace. |
|
| 14 | - * |
|
| 15 | - * @var string |
|
| 16 | - */ |
|
| 17 | - protected $namespace = 'App\Modules\Acl\Http\Controllers'; |
|
| 11 | + * This namespace is applied to your controller routes. |
|
| 12 | + * |
|
| 13 | + * In addition, it is set as the URL generator's root namespace. |
|
| 14 | + * |
|
| 15 | + * @var string |
|
| 16 | + */ |
|
| 17 | + protected $namespace = 'App\Modules\Acl\Http\Controllers'; |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Define your route model bindings, pattern filters, etc. |
|
| 21 | - * |
|
| 22 | - * @return void |
|
| 23 | - */ |
|
| 24 | - public function boot() |
|
| 25 | - { |
|
| 26 | - // |
|
| 19 | + /** |
|
| 20 | + * Define your route model bindings, pattern filters, etc. |
|
| 21 | + * |
|
| 22 | + * @return void |
|
| 23 | + */ |
|
| 24 | + public function boot() |
|
| 25 | + { |
|
| 26 | + // |
|
| 27 | 27 | |
| 28 | - parent::boot(); |
|
| 29 | - } |
|
| 28 | + parent::boot(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Define the routes for the module. |
|
| 33 | - * |
|
| 34 | - * @return void |
|
| 35 | - */ |
|
| 36 | - public function map() |
|
| 37 | - { |
|
| 38 | - $this->mapWebRoutes(); |
|
| 31 | + /** |
|
| 32 | + * Define the routes for the module. |
|
| 33 | + * |
|
| 34 | + * @return void |
|
| 35 | + */ |
|
| 36 | + public function map() |
|
| 37 | + { |
|
| 38 | + $this->mapWebRoutes(); |
|
| 39 | 39 | |
| 40 | - $this->mapApiRoutes(); |
|
| 40 | + $this->mapApiRoutes(); |
|
| 41 | 41 | |
| 42 | - // |
|
| 43 | - } |
|
| 42 | + // |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Define the "web" routes for the module. |
|
| 47 | - * |
|
| 48 | - * These routes all receive session state, CSRF protection, etc. |
|
| 49 | - * |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - protected function mapWebRoutes() |
|
| 53 | - { |
|
| 54 | - Route::group([ |
|
| 55 | - 'middleware' => 'web', |
|
| 56 | - 'namespace' => $this->namespace, |
|
| 57 | - ], function ($router) { |
|
| 58 | - require module_path('acl', 'Routes/web.php'); |
|
| 59 | - }); |
|
| 60 | - } |
|
| 45 | + /** |
|
| 46 | + * Define the "web" routes for the module. |
|
| 47 | + * |
|
| 48 | + * These routes all receive session state, CSRF protection, etc. |
|
| 49 | + * |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + protected function mapWebRoutes() |
|
| 53 | + { |
|
| 54 | + Route::group([ |
|
| 55 | + 'middleware' => 'web', |
|
| 56 | + 'namespace' => $this->namespace, |
|
| 57 | + ], function ($router) { |
|
| 58 | + require module_path('acl', 'Routes/web.php'); |
|
| 59 | + }); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Define the "api" routes for the module. |
|
| 64 | - * |
|
| 65 | - * These routes are typically stateless. |
|
| 66 | - * |
|
| 67 | - * @return void |
|
| 68 | - */ |
|
| 69 | - protected function mapApiRoutes() |
|
| 70 | - { |
|
| 71 | - Route::group([ |
|
| 72 | - 'middleware' => 'api', |
|
| 73 | - 'namespace' => $this->namespace, |
|
| 74 | - 'prefix' => 'api', |
|
| 75 | - ], function ($router) { |
|
| 76 | - require module_path('acl', 'Routes/api.php'); |
|
| 77 | - }); |
|
| 78 | - } |
|
| 62 | + /** |
|
| 63 | + * Define the "api" routes for the module. |
|
| 64 | + * |
|
| 65 | + * These routes are typically stateless. |
|
| 66 | + * |
|
| 67 | + * @return void |
|
| 68 | + */ |
|
| 69 | + protected function mapApiRoutes() |
|
| 70 | + { |
|
| 71 | + Route::group([ |
|
| 72 | + 'middleware' => 'api', |
|
| 73 | + 'namespace' => $this->namespace, |
|
| 74 | + 'prefix' => 'api', |
|
| 75 | + ], function ($router) { |
|
| 76 | + require module_path('acl', 'Routes/api.php'); |
|
| 77 | + }); |
|
| 78 | + } |
|
| 79 | 79 | } |
@@ -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', 'acl'); |
|
| 17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'acl'); |
|
| 9 | + /** |
|
| 10 | + * Bootstrap the module services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'acl'); |
|
| 17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'acl'); |
|
| 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 | } |
@@ -7,119 +7,119 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AclUser extends User { |
| 9 | 9 | |
| 10 | - use SoftDeletes, HasApiTokens; |
|
| 11 | - protected $table = 'users'; |
|
| 12 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 13 | - protected $hidden = ['password', 'remember_token','deleted_at', 'two_factor_code']; |
|
| 14 | - protected $guarded = ['id']; |
|
| 15 | - protected $fillable = ['profile_picture', 'name', 'email', 'password']; |
|
| 16 | - public $searchable = ['name', 'email']; |
|
| 10 | + use SoftDeletes, HasApiTokens; |
|
| 11 | + protected $table = 'users'; |
|
| 12 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 13 | + protected $hidden = ['password', 'remember_token','deleted_at', 'two_factor_code']; |
|
| 14 | + protected $guarded = ['id']; |
|
| 15 | + protected $fillable = ['profile_picture', 'name', 'email', 'password']; |
|
| 16 | + public $searchable = ['name', 'email']; |
|
| 17 | 17 | |
| 18 | - public function getCreatedAtAttribute($value) |
|
| 19 | - { |
|
| 20 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function getUpdatedAtAttribute($value) |
|
| 24 | - { |
|
| 25 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function getDeletedAtAttribute($value) |
|
| 29 | - { |
|
| 30 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Encrypt the password attribute before |
|
| 35 | - * saving it in the storage. |
|
| 36 | - * |
|
| 37 | - * @param string $value |
|
| 38 | - */ |
|
| 39 | - public function setPasswordAttribute($value) |
|
| 40 | - { |
|
| 41 | - $this->attributes['password'] = bcrypt($value); |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Get the entity's notifications. |
|
| 46 | - */ |
|
| 47 | - public function notifications() |
|
| 48 | - { |
|
| 49 | - return $this->morphMany('\App\Modules\Notifications\Notification', 'notifiable')->orderBy('created_at', 'desc'); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * Get the entity's read notifications. |
|
| 54 | - */ |
|
| 55 | - public function readNotifications() |
|
| 56 | - { |
|
| 57 | - return $this->notifications()->whereNotNull('read_at'); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Get the entity's unread notifications. |
|
| 62 | - */ |
|
| 63 | - public function unreadNotifications() |
|
| 64 | - { |
|
| 65 | - return $this->notifications()->whereNull('read_at'); |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - public function groups() |
|
| 69 | - { |
|
| 70 | - return $this->belongsToMany('\App\Modules\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - public function oauthClients() |
|
| 74 | - { |
|
| 75 | - return $this->hasMany('App\Modules\Acl\OauthClient', 'user_id'); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * Return fcm device tokens that will be used in sending fcm notifications. |
|
| 80 | - * |
|
| 81 | - * @return array |
|
| 82 | - */ |
|
| 83 | - public function routeNotificationForFCM() |
|
| 84 | - { |
|
| 85 | - $devices = \Core::pushNotificationsDevices()->findBy(['user_id' => $this->id]); |
|
| 86 | - $tokens = []; |
|
| 87 | - |
|
| 88 | - foreach ($devices as $device) |
|
| 89 | - { |
|
| 90 | - $accessToken = decrypt($device->access_token); |
|
| 91 | - |
|
| 92 | - try |
|
| 93 | - { |
|
| 94 | - if (\Core::users()->accessTokenExpiredOrRevoked($accessToken)) |
|
| 95 | - { |
|
| 96 | - continue; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - $tokens[] = $device->device_token; |
|
| 100 | - } |
|
| 101 | - catch (\Exception $e) |
|
| 102 | - { |
|
| 103 | - $device->forceDelete(); |
|
| 104 | - } |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - return $tokens; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * The channels the user receives notification broadcasts on. |
|
| 112 | - * |
|
| 113 | - * @return string |
|
| 114 | - */ |
|
| 115 | - public function receivesBroadcastNotificationsOn() |
|
| 116 | - { |
|
| 117 | - return 'users.' . $this->id; |
|
| 118 | - } |
|
| 18 | + public function getCreatedAtAttribute($value) |
|
| 19 | + { |
|
| 20 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function getUpdatedAtAttribute($value) |
|
| 24 | + { |
|
| 25 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + public function getDeletedAtAttribute($value) |
|
| 29 | + { |
|
| 30 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Encrypt the password attribute before |
|
| 35 | + * saving it in the storage. |
|
| 36 | + * |
|
| 37 | + * @param string $value |
|
| 38 | + */ |
|
| 39 | + public function setPasswordAttribute($value) |
|
| 40 | + { |
|
| 41 | + $this->attributes['password'] = bcrypt($value); |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Get the entity's notifications. |
|
| 46 | + */ |
|
| 47 | + public function notifications() |
|
| 48 | + { |
|
| 49 | + return $this->morphMany('\App\Modules\Notifications\Notification', 'notifiable')->orderBy('created_at', 'desc'); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Get the entity's read notifications. |
|
| 54 | + */ |
|
| 55 | + public function readNotifications() |
|
| 56 | + { |
|
| 57 | + return $this->notifications()->whereNotNull('read_at'); |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Get the entity's unread notifications. |
|
| 62 | + */ |
|
| 63 | + public function unreadNotifications() |
|
| 64 | + { |
|
| 65 | + return $this->notifications()->whereNull('read_at'); |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + public function groups() |
|
| 69 | + { |
|
| 70 | + return $this->belongsToMany('\App\Modules\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + public function oauthClients() |
|
| 74 | + { |
|
| 75 | + return $this->hasMany('App\Modules\Acl\OauthClient', 'user_id'); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * Return fcm device tokens that will be used in sending fcm notifications. |
|
| 80 | + * |
|
| 81 | + * @return array |
|
| 82 | + */ |
|
| 83 | + public function routeNotificationForFCM() |
|
| 84 | + { |
|
| 85 | + $devices = \Core::pushNotificationsDevices()->findBy(['user_id' => $this->id]); |
|
| 86 | + $tokens = []; |
|
| 87 | + |
|
| 88 | + foreach ($devices as $device) |
|
| 89 | + { |
|
| 90 | + $accessToken = decrypt($device->access_token); |
|
| 91 | + |
|
| 92 | + try |
|
| 93 | + { |
|
| 94 | + if (\Core::users()->accessTokenExpiredOrRevoked($accessToken)) |
|
| 95 | + { |
|
| 96 | + continue; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + $tokens[] = $device->device_token; |
|
| 100 | + } |
|
| 101 | + catch (\Exception $e) |
|
| 102 | + { |
|
| 103 | + $device->forceDelete(); |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + return $tokens; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * The channels the user receives notification broadcasts on. |
|
| 112 | + * |
|
| 113 | + * @return string |
|
| 114 | + */ |
|
| 115 | + public function receivesBroadcastNotificationsOn() |
|
| 116 | + { |
|
| 117 | + return 'users.' . $this->id; |
|
| 118 | + } |
|
| 119 | 119 | |
| 120 | - public static function boot() |
|
| 121 | - { |
|
| 122 | - parent::boot(); |
|
| 123 | - parent::observe(\App::make('App\Modules\Acl\ModelObservers\AclUserObserver')); |
|
| 124 | - } |
|
| 120 | + public static function boot() |
|
| 121 | + { |
|
| 122 | + parent::boot(); |
|
| 123 | + parent::observe(\App::make('App\Modules\Acl\ModelObservers\AclUserObserver')); |
|
| 124 | + } |
|
| 125 | 125 | } |
@@ -5,42 +5,42 @@ |
||
| 5 | 5 | |
| 6 | 6 | class AclGroup extends Model{ |
| 7 | 7 | |
| 8 | - use SoftDeletes; |
|
| 9 | - protected $table = 'groups'; |
|
| 10 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | - protected $hidden = ['deleted_at']; |
|
| 12 | - protected $guarded = ['id']; |
|
| 13 | - protected $fillable = ['name']; |
|
| 14 | - public $searchable = ['name']; |
|
| 15 | - |
|
| 16 | - public function getCreatedAtAttribute($value) |
|
| 17 | - { |
|
| 18 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - public function getUpdatedAtAttribute($value) |
|
| 22 | - { |
|
| 23 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function getDeletedAtAttribute($value) |
|
| 27 | - { |
|
| 28 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - public function users() |
|
| 32 | - { |
|
| 33 | - return $this->belongsToMany('\App\Modules\Acl\AclUser','users_groups','group_id','user_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - public function permissions() |
|
| 37 | - { |
|
| 38 | - return $this->belongsToMany('\App\Modules\Acl\AclPermission','groups_permissions','group_id','permission_id')->whereNull('groups_permissions.deleted_at')->withTimestamps(); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public static function boot() |
|
| 42 | - { |
|
| 43 | - parent::boot(); |
|
| 44 | - parent::observe(\App::make('App\Modules\Acl\ModelObservers\AclGroupObserver')); |
|
| 45 | - } |
|
| 8 | + use SoftDeletes; |
|
| 9 | + protected $table = 'groups'; |
|
| 10 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | + protected $hidden = ['deleted_at']; |
|
| 12 | + protected $guarded = ['id']; |
|
| 13 | + protected $fillable = ['name']; |
|
| 14 | + public $searchable = ['name']; |
|
| 15 | + |
|
| 16 | + public function getCreatedAtAttribute($value) |
|
| 17 | + { |
|
| 18 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + public function getUpdatedAtAttribute($value) |
|
| 22 | + { |
|
| 23 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function getDeletedAtAttribute($value) |
|
| 27 | + { |
|
| 28 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + public function users() |
|
| 32 | + { |
|
| 33 | + return $this->belongsToMany('\App\Modules\Acl\AclUser','users_groups','group_id','user_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + public function permissions() |
|
| 37 | + { |
|
| 38 | + return $this->belongsToMany('\App\Modules\Acl\AclPermission','groups_permissions','group_id','permission_id')->whereNull('groups_permissions.deleted_at')->withTimestamps(); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public static function boot() |
|
| 42 | + { |
|
| 43 | + parent::boot(); |
|
| 44 | + parent::observe(\App::make('App\Modules\Acl\ModelObservers\AclGroupObserver')); |
|
| 45 | + } |
|
| 46 | 46 | } |
@@ -6,94 +6,94 @@ |
||
| 6 | 6 | |
| 7 | 7 | class GroupsTableSeeder 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 groups table. |
|
| 18 | - */ |
|
| 19 | - \DB::table('permissions')->insert( |
|
| 20 | - [ |
|
| 21 | - /** |
|
| 22 | - * Groups model permissions. |
|
| 23 | - */ |
|
| 24 | - [ |
|
| 25 | - 'name' => 'save', |
|
| 26 | - 'model' => 'groups', |
|
| 27 | - 'created_at' => \DB::raw('NOW()'), |
|
| 28 | - 'updated_at' => \DB::raw('NOW()') |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'delete', |
|
| 32 | - 'model' => 'groups', |
|
| 33 | - 'created_at' => \DB::raw('NOW()'), |
|
| 34 | - 'updated_at' => \DB::raw('NOW()') |
|
| 35 | - ], |
|
| 36 | - [ |
|
| 37 | - 'name' => 'find', |
|
| 38 | - 'model' => 'groups', |
|
| 39 | - 'created_at' => \DB::raw('NOW()'), |
|
| 40 | - 'updated_at' => \DB::raw('NOW()') |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - 'name' => 'search', |
|
| 44 | - 'model' => 'groups', |
|
| 45 | - 'created_at' => \DB::raw('NOW()'), |
|
| 46 | - 'updated_at' => \DB::raw('NOW()') |
|
| 47 | - ], |
|
| 48 | - [ |
|
| 49 | - 'name' => 'list', |
|
| 50 | - 'model' => 'groups', |
|
| 51 | - 'created_at' => \DB::raw('NOW()'), |
|
| 52 | - 'updated_at' => \DB::raw('NOW()') |
|
| 53 | - ], |
|
| 54 | - [ |
|
| 55 | - 'name' => 'findby', |
|
| 56 | - 'model' => 'groups', |
|
| 57 | - 'created_at' => \DB::raw('NOW()'), |
|
| 58 | - 'updated_at' => \DB::raw('NOW()') |
|
| 59 | - ], |
|
| 60 | - [ |
|
| 61 | - 'name' => 'first', |
|
| 62 | - 'model' => 'groups', |
|
| 63 | - 'created_at' => \DB::raw('NOW()'), |
|
| 64 | - 'updated_at' => \DB::raw('NOW()') |
|
| 65 | - ], |
|
| 66 | - [ |
|
| 67 | - 'name' => 'paginate', |
|
| 68 | - 'model' => 'groups', |
|
| 69 | - 'created_at' => \DB::raw('NOW()'), |
|
| 70 | - 'updated_at' => \DB::raw('NOW()') |
|
| 71 | - ], |
|
| 72 | - [ |
|
| 73 | - 'name' => 'paginateby', |
|
| 74 | - 'model' => 'groups', |
|
| 75 | - 'created_at' => \DB::raw('NOW()'), |
|
| 76 | - 'updated_at' => \DB::raw('NOW()') |
|
| 77 | - ], |
|
| 78 | - [ |
|
| 79 | - 'name' => 'assignpermissions', |
|
| 80 | - 'model' => 'groups', |
|
| 81 | - 'created_at' => \DB::raw('NOW()'), |
|
| 82 | - 'updated_at' => \DB::raw('NOW()') |
|
| 83 | - ], |
|
| 84 | - [ |
|
| 85 | - 'name' => 'deleted', |
|
| 86 | - 'model' => 'groups', |
|
| 87 | - 'created_at' => \DB::raw('NOW()'), |
|
| 88 | - 'updated_at' => \DB::raw('NOW()') |
|
| 89 | - ], |
|
| 90 | - [ |
|
| 91 | - 'name' => 'restore', |
|
| 92 | - 'model' => 'groups', |
|
| 93 | - 'created_at' => \DB::raw('NOW()'), |
|
| 94 | - 'updated_at' => \DB::raw('NOW()') |
|
| 95 | - ] |
|
| 96 | - ] |
|
| 97 | - ); |
|
| 98 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + /** |
|
| 17 | + * Insert the permissions related to groups table. |
|
| 18 | + */ |
|
| 19 | + \DB::table('permissions')->insert( |
|
| 20 | + [ |
|
| 21 | + /** |
|
| 22 | + * Groups model permissions. |
|
| 23 | + */ |
|
| 24 | + [ |
|
| 25 | + 'name' => 'save', |
|
| 26 | + 'model' => 'groups', |
|
| 27 | + 'created_at' => \DB::raw('NOW()'), |
|
| 28 | + 'updated_at' => \DB::raw('NOW()') |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'delete', |
|
| 32 | + 'model' => 'groups', |
|
| 33 | + 'created_at' => \DB::raw('NOW()'), |
|
| 34 | + 'updated_at' => \DB::raw('NOW()') |
|
| 35 | + ], |
|
| 36 | + [ |
|
| 37 | + 'name' => 'find', |
|
| 38 | + 'model' => 'groups', |
|
| 39 | + 'created_at' => \DB::raw('NOW()'), |
|
| 40 | + 'updated_at' => \DB::raw('NOW()') |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + 'name' => 'search', |
|
| 44 | + 'model' => 'groups', |
|
| 45 | + 'created_at' => \DB::raw('NOW()'), |
|
| 46 | + 'updated_at' => \DB::raw('NOW()') |
|
| 47 | + ], |
|
| 48 | + [ |
|
| 49 | + 'name' => 'list', |
|
| 50 | + 'model' => 'groups', |
|
| 51 | + 'created_at' => \DB::raw('NOW()'), |
|
| 52 | + 'updated_at' => \DB::raw('NOW()') |
|
| 53 | + ], |
|
| 54 | + [ |
|
| 55 | + 'name' => 'findby', |
|
| 56 | + 'model' => 'groups', |
|
| 57 | + 'created_at' => \DB::raw('NOW()'), |
|
| 58 | + 'updated_at' => \DB::raw('NOW()') |
|
| 59 | + ], |
|
| 60 | + [ |
|
| 61 | + 'name' => 'first', |
|
| 62 | + 'model' => 'groups', |
|
| 63 | + 'created_at' => \DB::raw('NOW()'), |
|
| 64 | + 'updated_at' => \DB::raw('NOW()') |
|
| 65 | + ], |
|
| 66 | + [ |
|
| 67 | + 'name' => 'paginate', |
|
| 68 | + 'model' => 'groups', |
|
| 69 | + 'created_at' => \DB::raw('NOW()'), |
|
| 70 | + 'updated_at' => \DB::raw('NOW()') |
|
| 71 | + ], |
|
| 72 | + [ |
|
| 73 | + 'name' => 'paginateby', |
|
| 74 | + 'model' => 'groups', |
|
| 75 | + 'created_at' => \DB::raw('NOW()'), |
|
| 76 | + 'updated_at' => \DB::raw('NOW()') |
|
| 77 | + ], |
|
| 78 | + [ |
|
| 79 | + 'name' => 'assignpermissions', |
|
| 80 | + 'model' => 'groups', |
|
| 81 | + 'created_at' => \DB::raw('NOW()'), |
|
| 82 | + 'updated_at' => \DB::raw('NOW()') |
|
| 83 | + ], |
|
| 84 | + [ |
|
| 85 | + 'name' => 'deleted', |
|
| 86 | + 'model' => 'groups', |
|
| 87 | + 'created_at' => \DB::raw('NOW()'), |
|
| 88 | + 'updated_at' => \DB::raw('NOW()') |
|
| 89 | + ], |
|
| 90 | + [ |
|
| 91 | + 'name' => 'restore', |
|
| 92 | + 'model' => 'groups', |
|
| 93 | + 'created_at' => \DB::raw('NOW()'), |
|
| 94 | + 'updated_at' => \DB::raw('NOW()') |
|
| 95 | + ] |
|
| 96 | + ] |
|
| 97 | + ); |
|
| 98 | + } |
|
| 99 | 99 | } |
@@ -6,82 +6,82 @@ |
||
| 6 | 6 | |
| 7 | 7 | class OauthClientsTableSeeder 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 oauthClients table. |
|
| 18 | - */ |
|
| 19 | - \DB::table('permissions')->insert( |
|
| 20 | - [ |
|
| 21 | - /** |
|
| 22 | - * Users model permissions. |
|
| 23 | - */ |
|
| 24 | - [ |
|
| 25 | - 'name' => 'list', |
|
| 26 | - 'model' => 'oauthClients', |
|
| 27 | - 'created_at' => \DB::raw('NOW()'), |
|
| 28 | - 'updated_at' => \DB::raw('NOW()') |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'find', |
|
| 32 | - 'model' => 'oauthClients', |
|
| 33 | - 'created_at' => \DB::raw('NOW()'), |
|
| 34 | - 'updated_at' => \DB::raw('NOW()') |
|
| 35 | - ], |
|
| 36 | - [ |
|
| 37 | - 'name' => 'search', |
|
| 38 | - 'model' => 'oauthClients', |
|
| 39 | - 'created_at' => \DB::raw('NOW()'), |
|
| 40 | - 'updated_at' => \DB::raw('NOW()') |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - 'name' => 'paginate', |
|
| 44 | - 'model' => 'oauthClients', |
|
| 45 | - 'created_at' => \DB::raw('NOW()'), |
|
| 46 | - 'updated_at' => \DB::raw('NOW()') |
|
| 47 | - ], |
|
| 48 | - [ |
|
| 49 | - 'name' => 'revoke', |
|
| 50 | - 'model' => 'oauthClients', |
|
| 51 | - 'created_at' => \DB::raw('NOW()'), |
|
| 52 | - 'updated_at' => \DB::raw('NOW()') |
|
| 53 | - ], |
|
| 54 | - [ |
|
| 55 | - 'name' => 'unRevoke', |
|
| 56 | - 'model' => 'oauthClients', |
|
| 57 | - 'created_at' => \DB::raw('NOW()'), |
|
| 58 | - 'updated_at' => \DB::raw('NOW()') |
|
| 59 | - ], |
|
| 60 | - [ |
|
| 61 | - 'name' => 'first', |
|
| 62 | - 'model' => 'oauthClients', |
|
| 63 | - 'created_at' => \DB::raw('NOW()'), |
|
| 64 | - 'updated_at' => \DB::raw('NOW()') |
|
| 65 | - ], |
|
| 66 | - [ |
|
| 67 | - 'name' => 'findby', |
|
| 68 | - 'model' => 'oauthClients', |
|
| 69 | - 'created_at' => \DB::raw('NOW()'), |
|
| 70 | - 'updated_at' => \DB::raw('NOW()') |
|
| 71 | - ], |
|
| 72 | - [ |
|
| 73 | - 'name' => 'paginateby', |
|
| 74 | - 'model' => 'oauthClients', |
|
| 75 | - 'created_at' => \DB::raw('NOW()'), |
|
| 76 | - 'updated_at' => \DB::raw('NOW()') |
|
| 77 | - ], |
|
| 78 | - [ |
|
| 79 | - 'name' => 'save', |
|
| 80 | - 'model' => 'oauthClients', |
|
| 81 | - 'created_at' => \DB::raw('NOW()'), |
|
| 82 | - 'updated_at' => \DB::raw('NOW()') |
|
| 83 | - ] |
|
| 84 | - ] |
|
| 85 | - ); |
|
| 86 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + /** |
|
| 17 | + * Insert the permissions related to oauthClients table. |
|
| 18 | + */ |
|
| 19 | + \DB::table('permissions')->insert( |
|
| 20 | + [ |
|
| 21 | + /** |
|
| 22 | + * Users model permissions. |
|
| 23 | + */ |
|
| 24 | + [ |
|
| 25 | + 'name' => 'list', |
|
| 26 | + 'model' => 'oauthClients', |
|
| 27 | + 'created_at' => \DB::raw('NOW()'), |
|
| 28 | + 'updated_at' => \DB::raw('NOW()') |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'find', |
|
| 32 | + 'model' => 'oauthClients', |
|
| 33 | + 'created_at' => \DB::raw('NOW()'), |
|
| 34 | + 'updated_at' => \DB::raw('NOW()') |
|
| 35 | + ], |
|
| 36 | + [ |
|
| 37 | + 'name' => 'search', |
|
| 38 | + 'model' => 'oauthClients', |
|
| 39 | + 'created_at' => \DB::raw('NOW()'), |
|
| 40 | + 'updated_at' => \DB::raw('NOW()') |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + 'name' => 'paginate', |
|
| 44 | + 'model' => 'oauthClients', |
|
| 45 | + 'created_at' => \DB::raw('NOW()'), |
|
| 46 | + 'updated_at' => \DB::raw('NOW()') |
|
| 47 | + ], |
|
| 48 | + [ |
|
| 49 | + 'name' => 'revoke', |
|
| 50 | + 'model' => 'oauthClients', |
|
| 51 | + 'created_at' => \DB::raw('NOW()'), |
|
| 52 | + 'updated_at' => \DB::raw('NOW()') |
|
| 53 | + ], |
|
| 54 | + [ |
|
| 55 | + 'name' => 'unRevoke', |
|
| 56 | + 'model' => 'oauthClients', |
|
| 57 | + 'created_at' => \DB::raw('NOW()'), |
|
| 58 | + 'updated_at' => \DB::raw('NOW()') |
|
| 59 | + ], |
|
| 60 | + [ |
|
| 61 | + 'name' => 'first', |
|
| 62 | + 'model' => 'oauthClients', |
|
| 63 | + 'created_at' => \DB::raw('NOW()'), |
|
| 64 | + 'updated_at' => \DB::raw('NOW()') |
|
| 65 | + ], |
|
| 66 | + [ |
|
| 67 | + 'name' => 'findby', |
|
| 68 | + 'model' => 'oauthClients', |
|
| 69 | + 'created_at' => \DB::raw('NOW()'), |
|
| 70 | + 'updated_at' => \DB::raw('NOW()') |
|
| 71 | + ], |
|
| 72 | + [ |
|
| 73 | + 'name' => 'paginateby', |
|
| 74 | + 'model' => 'oauthClients', |
|
| 75 | + 'created_at' => \DB::raw('NOW()'), |
|
| 76 | + 'updated_at' => \DB::raw('NOW()') |
|
| 77 | + ], |
|
| 78 | + [ |
|
| 79 | + 'name' => 'save', |
|
| 80 | + 'model' => 'oauthClients', |
|
| 81 | + 'created_at' => \DB::raw('NOW()'), |
|
| 82 | + 'updated_at' => \DB::raw('NOW()') |
|
| 83 | + ] |
|
| 84 | + ] |
|
| 85 | + ); |
|
| 86 | + } |
|
| 87 | 87 | } |