@@ -9,43 +9,43 @@ |
||
| 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 | - * Init new object. |
|
| 18 | - * |
|
| 19 | - * @return void |
|
| 20 | - */ |
|
| 21 | - public function __construct($token) |
|
| 22 | - { |
|
| 23 | - $this->token = $token; |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Init new object. |
|
| 18 | + * |
|
| 19 | + * @return void |
|
| 20 | + */ |
|
| 21 | + public function __construct($token) |
|
| 22 | + { |
|
| 23 | + $this->token = $token; |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Get the notification's delivery channels. |
|
| 28 | - * |
|
| 29 | - * @param mixed $notifiable |
|
| 30 | - * @return string[] |
|
| 31 | - */ |
|
| 32 | - public function via($notifiable) |
|
| 33 | - { |
|
| 34 | - return ['mail']; |
|
| 35 | - } |
|
| 26 | + /** |
|
| 27 | + * Get the notification's delivery channels. |
|
| 28 | + * |
|
| 29 | + * @param mixed $notifiable |
|
| 30 | + * @return string[] |
|
| 31 | + */ |
|
| 32 | + public function via($notifiable) |
|
| 33 | + { |
|
| 34 | + return ['mail']; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Get the mail representation of the notification. |
|
| 39 | - * |
|
| 40 | - * @param mixed $notifiable |
|
| 41 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 42 | - */ |
|
| 43 | - public function toMail($notifiable) |
|
| 44 | - { |
|
| 45 | - return (new MailMessage) |
|
| 46 | - ->subject('Reset passowrd') |
|
| 47 | - ->line('Reset passowrd') |
|
| 48 | - ->line('To reset your password click on the button below') |
|
| 49 | - ->action('Reset password', config('skeleton.reset_password_url').'/'.$this->token); |
|
| 50 | - } |
|
| 37 | + /** |
|
| 38 | + * Get the mail representation of the notification. |
|
| 39 | + * |
|
| 40 | + * @param mixed $notifiable |
|
| 41 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 42 | + */ |
|
| 43 | + public function toMail($notifiable) |
|
| 44 | + { |
|
| 45 | + return (new MailMessage) |
|
| 46 | + ->subject('Reset passowrd') |
|
| 47 | + ->line('Reset passowrd') |
|
| 48 | + ->line('To reset your password click on the button below') |
|
| 49 | + ->action('Reset password', config('skeleton.reset_password_url').'/'.$this->token); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -2,15 +2,15 @@ |
||
| 2 | 2 | |
| 3 | 3 | interface BaseFactoryInterface |
| 4 | 4 | { |
| 5 | - /** |
|
| 6 | - * Construct the repository class name based on |
|
| 7 | - * the method name called, search in the |
|
| 8 | - * given namespaces for the class and |
|
| 9 | - * return an instance. |
|
| 10 | - * |
|
| 11 | - * @param string $name the called method name |
|
| 12 | - * @param array $arguments the method arguments |
|
| 13 | - * @return object |
|
| 14 | - */ |
|
| 15 | - public function __call($name, $arguments); |
|
| 5 | + /** |
|
| 6 | + * Construct the repository class name based on |
|
| 7 | + * the method name called, search in the |
|
| 8 | + * given namespaces for the class and |
|
| 9 | + * return an instance. |
|
| 10 | + * |
|
| 11 | + * @param string $name the called method name |
|
| 12 | + * @param array $arguments the method arguments |
|
| 13 | + * @return object |
|
| 14 | + */ |
|
| 15 | + public function __call($name, $arguments); |
|
| 16 | 16 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @param Request $request |
| 35 | 35 | * @param string $reportName Name of the requested report |
| 36 | - * @return \Illuminate\Http\Response |
|
| 36 | + * @return \Illuminate\Http\JsonResponse |
|
| 37 | 37 | */ |
| 38 | 38 | public function getReport(Request $request, $reportName) |
| 39 | 39 | { |
@@ -8,33 +8,33 @@ |
||
| 8 | 8 | |
| 9 | 9 | class ReportController extends BaseApiController |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * List of all route actions that the base api controller |
|
| 13 | - * will skip permissions check for them. |
|
| 14 | - * @var array |
|
| 15 | - */ |
|
| 16 | - protected $skipPermissionCheck = ['getReport']; |
|
| 11 | + /** |
|
| 12 | + * List of all route actions that the base api controller |
|
| 13 | + * will skip permissions check for them. |
|
| 14 | + * @var array |
|
| 15 | + */ |
|
| 16 | + protected $skipPermissionCheck = ['getReport']; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Init new object. |
|
| 20 | - * |
|
| 21 | - * @param ReportRepository $repo |
|
| 22 | - * @return void |
|
| 23 | - */ |
|
| 24 | - public function __construct(ReportRepository $repo) |
|
| 25 | - { |
|
| 26 | - parent::__construct($repo, 'App\Modules\Reporting\Http\Resources\Report'); |
|
| 27 | - } |
|
| 18 | + /** |
|
| 19 | + * Init new object. |
|
| 20 | + * |
|
| 21 | + * @param ReportRepository $repo |
|
| 22 | + * @return void |
|
| 23 | + */ |
|
| 24 | + public function __construct(ReportRepository $repo) |
|
| 25 | + { |
|
| 26 | + parent::__construct($repo, 'App\Modules\Reporting\Http\Resources\Report'); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Render the given report name with the given conditions. |
|
| 31 | - * |
|
| 32 | - * @param Request $request |
|
| 33 | - * @param string $reportName Name of the requested report |
|
| 34 | - * @return \Illuminate\Http\Response |
|
| 35 | - */ |
|
| 36 | - public function getReport(Request $request, $reportName) |
|
| 37 | - { |
|
| 38 | - return \Response::json($this->repo->getReport($reportName, $request->all(), $request->query('perPage')), 200); |
|
| 39 | - } |
|
| 29 | + /** |
|
| 30 | + * Render the given report name with the given conditions. |
|
| 31 | + * |
|
| 32 | + * @param Request $request |
|
| 33 | + * @param string $reportName Name of the requested report |
|
| 34 | + * @return \Illuminate\Http\Response |
|
| 35 | + */ |
|
| 36 | + public function getReport(Request $request, $reportName) |
|
| 37 | + { |
|
| 38 | + return \Response::json($this->repo->getReport($reportName, $request->all(), $request->query('perPage')), 200); |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -6,46 +6,46 @@ |
||
| 6 | 6 | |
| 7 | 7 | class NotificationsTableSeeder 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 | - * notifications model permissions. |
|
| 23 | - */ |
|
| 24 | - [ |
|
| 25 | - 'name' => 'all', |
|
| 26 | - 'model' => 'notification', |
|
| 27 | - 'created_at' => \DB::raw('NOW()'), |
|
| 28 | - 'updated_at' => \DB::raw('NOW()') |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'unread', |
|
| 32 | - 'model' => 'notification', |
|
| 33 | - 'created_at' => \DB::raw('NOW()'), |
|
| 34 | - 'updated_at' => \DB::raw('NOW()') |
|
| 35 | - ], |
|
| 36 | - [ |
|
| 37 | - 'name' => 'markAsRead', |
|
| 38 | - 'model' => 'notification', |
|
| 39 | - 'created_at' => \DB::raw('NOW()'), |
|
| 40 | - 'updated_at' => \DB::raw('NOW()') |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - 'name' => 'markAllAsRead', |
|
| 44 | - 'model' => 'notification', |
|
| 45 | - 'created_at' => \DB::raw('NOW()'), |
|
| 46 | - 'updated_at' => \DB::raw('NOW()') |
|
| 47 | - ] |
|
| 48 | - ] |
|
| 49 | - ); |
|
| 50 | - } |
|
| 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 | + * notifications model permissions. |
|
| 23 | + */ |
|
| 24 | + [ |
|
| 25 | + 'name' => 'all', |
|
| 26 | + 'model' => 'notification', |
|
| 27 | + 'created_at' => \DB::raw('NOW()'), |
|
| 28 | + 'updated_at' => \DB::raw('NOW()') |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'unread', |
|
| 32 | + 'model' => 'notification', |
|
| 33 | + 'created_at' => \DB::raw('NOW()'), |
|
| 34 | + 'updated_at' => \DB::raw('NOW()') |
|
| 35 | + ], |
|
| 36 | + [ |
|
| 37 | + 'name' => 'markAsRead', |
|
| 38 | + 'model' => 'notification', |
|
| 39 | + 'created_at' => \DB::raw('NOW()'), |
|
| 40 | + 'updated_at' => \DB::raw('NOW()') |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + 'name' => 'markAllAsRead', |
|
| 44 | + 'model' => 'notification', |
|
| 45 | + 'created_at' => \DB::raw('NOW()'), |
|
| 46 | + 'updated_at' => \DB::raw('NOW()') |
|
| 47 | + ] |
|
| 48 | + ] |
|
| 49 | + ); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -6,40 +6,40 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ReportsTableSeeder 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 | - * Reports model permissions. |
|
| 23 | - */ |
|
| 24 | - [ |
|
| 25 | - 'name' => 'index', |
|
| 26 | - 'model' => 'report', |
|
| 27 | - 'created_at' => \DB::raw('NOW()'), |
|
| 28 | - 'updated_at' => \DB::raw('NOW()') |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'find', |
|
| 32 | - 'model' => 'report', |
|
| 33 | - 'created_at' => \DB::raw('NOW()'), |
|
| 34 | - 'updated_at' => \DB::raw('NOW()') |
|
| 35 | - ], |
|
| 36 | - [ |
|
| 37 | - 'name' => 'admin_count', |
|
| 38 | - 'model' => 'report', |
|
| 39 | - 'created_at' => \DB::raw('NOW()'), |
|
| 40 | - 'updated_at' => \DB::raw('NOW()') |
|
| 41 | - ] |
|
| 42 | - ] |
|
| 43 | - ); |
|
| 44 | - } |
|
| 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 | + * Reports model permissions. |
|
| 23 | + */ |
|
| 24 | + [ |
|
| 25 | + 'name' => 'index', |
|
| 26 | + 'model' => 'report', |
|
| 27 | + 'created_at' => \DB::raw('NOW()'), |
|
| 28 | + 'updated_at' => \DB::raw('NOW()') |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'find', |
|
| 32 | + 'model' => 'report', |
|
| 33 | + 'created_at' => \DB::raw('NOW()'), |
|
| 34 | + 'updated_at' => \DB::raw('NOW()') |
|
| 35 | + ], |
|
| 36 | + [ |
|
| 37 | + 'name' => 'admin_count', |
|
| 38 | + 'model' => 'report', |
|
| 39 | + 'created_at' => \DB::raw('NOW()'), |
|
| 40 | + 'updated_at' => \DB::raw('NOW()') |
|
| 41 | + ] |
|
| 42 | + ] |
|
| 43 | + ); |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -2,107 +2,107 @@ |
||
| 2 | 2 | |
| 3 | 3 | interface BaseRepositoryInterface |
| 4 | 4 | { |
| 5 | - /** |
|
| 6 | - * Fetch all records with relations from the storage. |
|
| 7 | - * |
|
| 8 | - * @param array $relations |
|
| 9 | - * @param array $sortBy |
|
| 10 | - * @param array $desc |
|
| 11 | - * @param array $columns |
|
| 12 | - * @return collection |
|
| 13 | - */ |
|
| 14 | - public function all($relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 5 | + /** |
|
| 6 | + * Fetch all records with relations from the storage. |
|
| 7 | + * |
|
| 8 | + * @param array $relations |
|
| 9 | + * @param array $sortBy |
|
| 10 | + * @param array $desc |
|
| 11 | + * @param array $columns |
|
| 12 | + * @return collection |
|
| 13 | + */ |
|
| 14 | + public function all($relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Fetch all records with relations from storage in pages |
|
| 18 | - * that matche the given query. |
|
| 19 | - * |
|
| 20 | - * @param string $query |
|
| 21 | - * @param integer $perPage |
|
| 22 | - * @param array $relations |
|
| 23 | - * @param array $sortBy |
|
| 24 | - * @param array $desc |
|
| 25 | - * @param array $columns |
|
| 26 | - * @return collection |
|
| 27 | - */ |
|
| 28 | - public function search($query, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 16 | + /** |
|
| 17 | + * Fetch all records with relations from storage in pages |
|
| 18 | + * that matche the given query. |
|
| 19 | + * |
|
| 20 | + * @param string $query |
|
| 21 | + * @param integer $perPage |
|
| 22 | + * @param array $relations |
|
| 23 | + * @param array $sortBy |
|
| 24 | + * @param array $desc |
|
| 25 | + * @param array $columns |
|
| 26 | + * @return collection |
|
| 27 | + */ |
|
| 28 | + public function search($query, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Fetch all records with relations from storage in pages. |
|
| 32 | - * |
|
| 33 | - * @param integer $perPage |
|
| 34 | - * @param array $relations |
|
| 35 | - * @param array $sortBy |
|
| 36 | - * @param array $desc |
|
| 37 | - * @param array $columns |
|
| 38 | - * @return collection |
|
| 39 | - */ |
|
| 40 | - public function paginate($perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 30 | + /** |
|
| 31 | + * Fetch all records with relations from storage in pages. |
|
| 32 | + * |
|
| 33 | + * @param integer $perPage |
|
| 34 | + * @param array $relations |
|
| 35 | + * @param array $sortBy |
|
| 36 | + * @param array $desc |
|
| 37 | + * @param array $columns |
|
| 38 | + * @return collection |
|
| 39 | + */ |
|
| 40 | + public function paginate($perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * Fetch all records with relations based on |
|
| 44 | - * the given condition from storage in pages. |
|
| 45 | - * |
|
| 46 | - * @param array $conditions array of conditions |
|
| 47 | - * @param integer $perPage |
|
| 48 | - * @param array $relations |
|
| 49 | - * @param array $sortBy |
|
| 50 | - * @param array $desc |
|
| 51 | - * @param array $columns |
|
| 52 | - * @return collection |
|
| 53 | - */ |
|
| 54 | - public function paginateBy($conditions, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 42 | + /** |
|
| 43 | + * Fetch all records with relations based on |
|
| 44 | + * the given condition from storage in pages. |
|
| 45 | + * |
|
| 46 | + * @param array $conditions array of conditions |
|
| 47 | + * @param integer $perPage |
|
| 48 | + * @param array $relations |
|
| 49 | + * @param array $sortBy |
|
| 50 | + * @param array $desc |
|
| 51 | + * @param array $columns |
|
| 52 | + * @return collection |
|
| 53 | + */ |
|
| 54 | + public function paginateBy($conditions, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Save the given model/models to the storage. |
|
| 58 | - * |
|
| 59 | - * @param array $data |
|
| 60 | - * @return mixed |
|
| 61 | - */ |
|
| 62 | - public function save(array $data); |
|
| 56 | + /** |
|
| 57 | + * Save the given model/models to the storage. |
|
| 58 | + * |
|
| 59 | + * @param array $data |
|
| 60 | + * @return mixed |
|
| 61 | + */ |
|
| 62 | + public function save(array $data); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Delete record from the storage based on the given |
|
| 66 | - * condition. |
|
| 67 | - * |
|
| 68 | - * @param var $value condition value |
|
| 69 | - * @param string $attribute condition column name |
|
| 70 | - * @return integer affected rows |
|
| 71 | - */ |
|
| 72 | - public function delete($value, $attribute = 'id'); |
|
| 64 | + /** |
|
| 65 | + * Delete record from the storage based on the given |
|
| 66 | + * condition. |
|
| 67 | + * |
|
| 68 | + * @param var $value condition value |
|
| 69 | + * @param string $attribute condition column name |
|
| 70 | + * @return integer affected rows |
|
| 71 | + */ |
|
| 72 | + public function delete($value, $attribute = 'id'); |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Fetch records from the storage based on the given |
|
| 76 | - * id. |
|
| 77 | - * |
|
| 78 | - * @param integer $id |
|
| 79 | - * @param array $relations |
|
| 80 | - * @param array $columns |
|
| 81 | - * @return object |
|
| 82 | - */ |
|
| 83 | - public function find($id, $relations = [], $columns = array('*')); |
|
| 74 | + /** |
|
| 75 | + * Fetch records from the storage based on the given |
|
| 76 | + * id. |
|
| 77 | + * |
|
| 78 | + * @param integer $id |
|
| 79 | + * @param array $relations |
|
| 80 | + * @param array $columns |
|
| 81 | + * @return object |
|
| 82 | + */ |
|
| 83 | + public function find($id, $relations = [], $columns = array('*')); |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Fetch records from the storage based on the given |
|
| 87 | - * condition. |
|
| 88 | - * |
|
| 89 | - * @param array $conditions array of conditions |
|
| 90 | - * @param array $relations |
|
| 91 | - * @param array $sortBy |
|
| 92 | - * @param array $desc |
|
| 93 | - * @param array $columns |
|
| 94 | - * @return collection |
|
| 95 | - */ |
|
| 96 | - public function findBy($conditions, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 85 | + /** |
|
| 86 | + * Fetch records from the storage based on the given |
|
| 87 | + * condition. |
|
| 88 | + * |
|
| 89 | + * @param array $conditions array of conditions |
|
| 90 | + * @param array $relations |
|
| 91 | + * @param array $sortBy |
|
| 92 | + * @param array $desc |
|
| 93 | + * @param array $columns |
|
| 94 | + * @return collection |
|
| 95 | + */ |
|
| 96 | + public function findBy($conditions, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*')); |
|
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Fetch the first record fro the storage based on the given |
|
| 100 | - * condition. |
|
| 101 | - * |
|
| 102 | - * @param array $conditions array of conditions |
|
| 103 | - * @param array $relations |
|
| 104 | - * @param array $columns |
|
| 105 | - * @return object |
|
| 106 | - */ |
|
| 107 | - public function first($conditions, $relations = [], $columns = array('*')); |
|
| 98 | + /** |
|
| 99 | + * Fetch the first record fro the storage based on the given |
|
| 100 | + * condition. |
|
| 101 | + * |
|
| 102 | + * @param array $conditions array of conditions |
|
| 103 | + * @param array $relations |
|
| 104 | + * @param array $columns |
|
| 105 | + * @return object |
|
| 106 | + */ |
|
| 107 | + public function first($conditions, $relations = [], $columns = array('*')); |
|
| 108 | 108 | } |
@@ -6,14 +6,14 @@ |
||
| 6 | 6 | |
| 7 | 7 | class General extends JsonResource |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Transform the resource into an array. |
|
| 11 | - * |
|
| 12 | - * @param Request $request |
|
| 13 | - * @return array |
|
| 14 | - */ |
|
| 15 | - public function toArray($request) |
|
| 16 | - { |
|
| 17 | - return ['status' => $this->resource ?? 'success']; |
|
| 18 | - } |
|
| 9 | + /** |
|
| 10 | + * Transform the resource into an array. |
|
| 11 | + * |
|
| 12 | + * @param Request $request |
|
| 13 | + * @return array |
|
| 14 | + */ |
|
| 15 | + public function toArray($request) |
|
| 16 | + { |
|
| 17 | + return ['status' => $this->resource ?? 'success']; |
|
| 18 | + } |
|
| 19 | 19 | } |
@@ -6,26 +6,26 @@ |
||
| 6 | 6 | |
| 7 | 7 | class UpdateSetting extends FormRequest |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Determine if the user is authorized to make this request. |
|
| 11 | - * |
|
| 12 | - * @return bool |
|
| 13 | - */ |
|
| 14 | - public function authorize() |
|
| 15 | - { |
|
| 16 | - return true; |
|
| 17 | - } |
|
| 9 | + /** |
|
| 10 | + * Determine if the user is authorized to make this request. |
|
| 11 | + * |
|
| 12 | + * @return bool |
|
| 13 | + */ |
|
| 14 | + public function authorize() |
|
| 15 | + { |
|
| 16 | + return true; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Get the validation rules that apply to the request. |
|
| 21 | - * |
|
| 22 | - * @return array |
|
| 23 | - */ |
|
| 24 | - public function rules() |
|
| 25 | - { |
|
| 26 | - return [ |
|
| 27 | - 'id' => 'required|exists:settings,id', |
|
| 28 | - 'value' => 'required|string' |
|
| 29 | - ]; |
|
| 30 | - } |
|
| 19 | + /** |
|
| 20 | + * Get the validation rules that apply to the request. |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function rules() |
|
| 25 | + { |
|
| 26 | + return [ |
|
| 27 | + 'id' => 'required|exists:settings,id', |
|
| 28 | + 'value' => 'required|string' |
|
| 29 | + ]; |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -6,52 +6,52 @@ |
||
| 6 | 6 | |
| 7 | 7 | class SettingsTableSeeder 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 | - * Settings model permissions. |
|
| 23 | - */ |
|
| 24 | - [ |
|
| 25 | - 'name' => 'index', |
|
| 26 | - 'model' => 'setting', |
|
| 27 | - 'created_at' => \DB::raw('NOW()'), |
|
| 28 | - 'updated_at' => \DB::raw('NOW()') |
|
| 29 | - ], |
|
| 30 | - [ |
|
| 31 | - 'name' => 'find', |
|
| 32 | - 'model' => 'setting', |
|
| 33 | - 'created_at' => \DB::raw('NOW()'), |
|
| 34 | - 'updated_at' => \DB::raw('NOW()') |
|
| 35 | - ], |
|
| 36 | - [ |
|
| 37 | - 'name' => 'update', |
|
| 38 | - 'model' => 'setting', |
|
| 39 | - 'created_at' => \DB::raw('NOW()'), |
|
| 40 | - 'updated_at' => \DB::raw('NOW()') |
|
| 41 | - ], |
|
| 42 | - [ |
|
| 43 | - 'name' => 'delete', |
|
| 44 | - 'model' => 'setting', |
|
| 45 | - 'created_at' => \DB::raw('NOW()'), |
|
| 46 | - 'updated_at' => \DB::raw('NOW()') |
|
| 47 | - ], |
|
| 48 | - [ |
|
| 49 | - 'name' => 'saveMany', |
|
| 50 | - 'model' => 'setting', |
|
| 51 | - 'created_at' => \DB::raw('NOW()'), |
|
| 52 | - 'updated_at' => \DB::raw('NOW()') |
|
| 53 | - ] |
|
| 54 | - ] |
|
| 55 | - ); |
|
| 56 | - } |
|
| 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 | + * Settings model permissions. |
|
| 23 | + */ |
|
| 24 | + [ |
|
| 25 | + 'name' => 'index', |
|
| 26 | + 'model' => 'setting', |
|
| 27 | + 'created_at' => \DB::raw('NOW()'), |
|
| 28 | + 'updated_at' => \DB::raw('NOW()') |
|
| 29 | + ], |
|
| 30 | + [ |
|
| 31 | + 'name' => 'find', |
|
| 32 | + 'model' => 'setting', |
|
| 33 | + 'created_at' => \DB::raw('NOW()'), |
|
| 34 | + 'updated_at' => \DB::raw('NOW()') |
|
| 35 | + ], |
|
| 36 | + [ |
|
| 37 | + 'name' => 'update', |
|
| 38 | + 'model' => 'setting', |
|
| 39 | + 'created_at' => \DB::raw('NOW()'), |
|
| 40 | + 'updated_at' => \DB::raw('NOW()') |
|
| 41 | + ], |
|
| 42 | + [ |
|
| 43 | + 'name' => 'delete', |
|
| 44 | + 'model' => 'setting', |
|
| 45 | + 'created_at' => \DB::raw('NOW()'), |
|
| 46 | + 'updated_at' => \DB::raw('NOW()') |
|
| 47 | + ], |
|
| 48 | + [ |
|
| 49 | + 'name' => 'saveMany', |
|
| 50 | + 'model' => 'setting', |
|
| 51 | + 'created_at' => \DB::raw('NOW()'), |
|
| 52 | + 'updated_at' => \DB::raw('NOW()') |
|
| 53 | + ] |
|
| 54 | + ] |
|
| 55 | + ); |
|
| 56 | + } |
|
| 57 | 57 | } |