@@ -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 | } |
@@ -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 | } |
@@ -1,7 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Illuminate\Http\Request; |
|
| 4 | - |
|
| 5 | 3 | /* |
| 6 | 4 | |-------------------------------------------------------------------------- |
| 7 | 5 | | API Routes |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::group(['prefix' => 'permissions'], function () { |
|
| 16 | +Route::group(['prefix' => 'permissions'], function() { |
|
| 17 | 17 | |
| 18 | 18 | Route::get('/', 'PermissionController@index'); |
| 19 | 19 | Route::get('/{id}', 'PermissionController@find'); |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | Route::group(['prefix' => 'permissions'], function () { |
| 17 | 17 | |
| 18 | - Route::get('/', 'PermissionController@index'); |
|
| 19 | - Route::get('/{id}', 'PermissionController@find'); |
|
| 18 | + Route::get('/', 'PermissionController@index'); |
|
| 19 | + Route::get('/{id}', 'PermissionController@find'); |
|
| 20 | 20 | }); |