@@ -6,53 +6,53 @@ |
||
| 6 | 6 | class DummyObserver |
| 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 | } |
@@ -5,32 +5,32 @@ |
||
| 5 | 5 | |
| 6 | 6 | class DummyModel extends Model |
| 7 | 7 | { |
| 8 | - use SoftDeletes; |
|
| 9 | - protected $table = 'DummyTableName'; |
|
| 10 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | - protected $hidden = ['deleted_at']; |
|
| 12 | - protected $guarded = ['id']; |
|
| 13 | - protected $fillable = []; // Add attributes here |
|
| 14 | - public $searchable = []; // Add earchable attributes here |
|
| 8 | + use SoftDeletes; |
|
| 9 | + protected $table = 'DummyTableName'; |
|
| 10 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | + protected $hidden = ['deleted_at']; |
|
| 12 | + protected $guarded = ['id']; |
|
| 13 | + protected $fillable = []; // Add attributes here |
|
| 14 | + public $searchable = []; // Add earchable attributes here |
|
| 15 | 15 | |
| 16 | - public function getCreatedAtAttribute($value) |
|
| 17 | - { |
|
| 18 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 19 | - } |
|
| 16 | + public function getCreatedAtAttribute($value) |
|
| 17 | + { |
|
| 18 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function getUpdatedAtAttribute($value) |
|
| 22 | - { |
|
| 23 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 24 | - } |
|
| 21 | + public function getUpdatedAtAttribute($value) |
|
| 22 | + { |
|
| 23 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function getDeletedAtAttribute($value) |
|
| 27 | - { |
|
| 28 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 29 | - } |
|
| 26 | + public function getDeletedAtAttribute($value) |
|
| 27 | + { |
|
| 28 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - public static function boot() |
|
| 32 | - { |
|
| 33 | - parent::boot(); |
|
| 34 | - DummyModel::observe(\App::make('App\Modules\DummyModule\ModelObservers\DummyObserver')); |
|
| 35 | - } |
|
| 31 | + public static function boot() |
|
| 32 | + { |
|
| 33 | + parent::boot(); |
|
| 34 | + DummyModel::observe(\App::make('App\Modules\DummyModule\ModelObservers\DummyObserver')); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -6,23 +6,23 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DummyResource 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 | - if (! $this->resource) { |
|
| 18 | - return []; |
|
| 19 | - } |
|
| 9 | + /** |
|
| 10 | + * Transform the resource into an array. |
|
| 11 | + * |
|
| 12 | + * @param Request $request |
|
| 13 | + * @return array |
|
| 14 | + */ |
|
| 15 | + public function toArray($request) |
|
| 16 | + { |
|
| 17 | + if (! $this->resource) { |
|
| 18 | + return []; |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - return [ |
|
| 22 | - 'id' => $this->id, |
|
| 23 | - // Add attributes here |
|
| 24 | - 'created_at' => $this->created_at, |
|
| 25 | - 'updated_at' => $this->updated_at, |
|
| 26 | - ]; |
|
| 27 | - } |
|
| 21 | + return [ |
|
| 22 | + 'id' => $this->id, |
|
| 23 | + // Add attributes here |
|
| 24 | + 'created_at' => $this->created_at, |
|
| 25 | + 'updated_at' => $this->updated_at, |
|
| 26 | + ]; |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class UpdateDummy 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 | - // |
|
| 28 | - ]; |
|
| 29 | - } |
|
| 19 | + /** |
|
| 20 | + * Get the validation rules that apply to the request. |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function rules() |
|
| 25 | + { |
|
| 26 | + return [ |
|
| 27 | + // |
|
| 28 | + ]; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class InsertDummy 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 | - // |
|
| 28 | - ]; |
|
| 29 | - } |
|
| 19 | + /** |
|
| 20 | + * Get the validation rules that apply to the request. |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function rules() |
|
| 25 | + { |
|
| 26 | + return [ |
|
| 27 | + // |
|
| 28 | + ]; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -10,51 +10,51 @@ |
||
| 10 | 10 | |
| 11 | 11 | class DummyController extends BaseApiController |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * List of all route actions that the base api controller |
|
| 15 | - * will skip permissions check for them. |
|
| 16 | - * @var array |
|
| 17 | - */ |
|
| 18 | - protected $skipPermissionCheck = []; |
|
| 13 | + /** |
|
| 14 | + * List of all route actions that the base api controller |
|
| 15 | + * will skip permissions check for them. |
|
| 16 | + * @var array |
|
| 17 | + */ |
|
| 18 | + protected $skipPermissionCheck = []; |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * List of all route actions that the base api controller |
|
| 22 | - * will skip login check for them. |
|
| 23 | - * @var array |
|
| 24 | - */ |
|
| 25 | - protected $skipLoginCheck = []; |
|
| 20 | + /** |
|
| 21 | + * List of all route actions that the base api controller |
|
| 22 | + * will skip login check for them. |
|
| 23 | + * @var array |
|
| 24 | + */ |
|
| 25 | + protected $skipLoginCheck = []; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Init new object. |
|
| 29 | - * |
|
| 30 | - * @param DummyRepository $repo |
|
| 31 | - * @param CoreConfig $config |
|
| 32 | - * @return void |
|
| 33 | - */ |
|
| 34 | - public function __construct(DummyRepository $repo, CoreConfig $config) |
|
| 35 | - { |
|
| 36 | - parent::__construct($repo, $config, 'App\Modules\DummyModule\Http\Resources\DummyModel'); |
|
| 37 | - } |
|
| 27 | + /** |
|
| 28 | + * Init new object. |
|
| 29 | + * |
|
| 30 | + * @param DummyRepository $repo |
|
| 31 | + * @param CoreConfig $config |
|
| 32 | + * @return void |
|
| 33 | + */ |
|
| 34 | + public function __construct(DummyRepository $repo, CoreConfig $config) |
|
| 35 | + { |
|
| 36 | + parent::__construct($repo, $config, 'App\Modules\DummyModule\Http\Resources\DummyModel'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Insert the given model to storage. |
|
| 41 | - * |
|
| 42 | - * @param InsertDummy $request |
|
| 43 | - * @return \Illuminate\Http\Response |
|
| 44 | - */ |
|
| 45 | - public function insert(InsertDummy $request) |
|
| 46 | - { |
|
| 47 | - return new $this->modelResource($this->repo->save($request->all())); |
|
| 48 | - } |
|
| 39 | + /** |
|
| 40 | + * Insert the given model to storage. |
|
| 41 | + * |
|
| 42 | + * @param InsertDummy $request |
|
| 43 | + * @return \Illuminate\Http\Response |
|
| 44 | + */ |
|
| 45 | + public function insert(InsertDummy $request) |
|
| 46 | + { |
|
| 47 | + return new $this->modelResource($this->repo->save($request->all())); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Update the given model to storage. |
|
| 52 | - * |
|
| 53 | - * @param UpdateDummy $request |
|
| 54 | - * @return \Illuminate\Http\Response |
|
| 55 | - */ |
|
| 56 | - public function update(UpdateDummy $request) |
|
| 57 | - { |
|
| 58 | - return new $this->modelResource($this->repo->save($request->all())); |
|
| 59 | - } |
|
| 50 | + /** |
|
| 51 | + * Update the given model to storage. |
|
| 52 | + * |
|
| 53 | + * @param UpdateDummy $request |
|
| 54 | + * @return \Illuminate\Http\Response |
|
| 55 | + */ |
|
| 56 | + public function update(UpdateDummy $request) |
|
| 57 | + { |
|
| 58 | + return new $this->modelResource($this->repo->save($request->all())); |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | |
| 6 | 6 | class DummyRepository extends BaseRepository |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Init new object. |
|
| 10 | - * |
|
| 11 | - * @param DummyModel $model |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function __construct(DummyModel $model) |
|
| 15 | - { |
|
| 16 | - parent::__construct($model); |
|
| 17 | - } |
|
| 8 | + /** |
|
| 9 | + * Init new object. |
|
| 10 | + * |
|
| 11 | + * @param DummyModel $model |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function __construct(DummyModel $model) |
|
| 15 | + { |
|
| 16 | + parent::__construct($model); |
|
| 17 | + } |
|
| 18 | 18 | } |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | |
| 16 | 16 | Route::group(['prefix' => 'DummyRoutePrefix'], function () { |
| 17 | 17 | |
| 18 | - Route::get('/', 'DummyController@index'); |
|
| 19 | - Route::get('/{id}', 'DummyController@find'); |
|
| 20 | - Route::post('/', 'DummyController@insert'); |
|
| 21 | - Route::put('/', 'DummyController@update'); |
|
| 22 | - Route::delete('/{id}', 'DummyController@delete'); |
|
| 23 | - Route::get('list/deleted', 'DummyController@deleted'); |
|
| 24 | - Route::patch('restore/{id}', 'DummyController@restore'); |
|
| 18 | + Route::get('/', 'DummyController@index'); |
|
| 19 | + Route::get('/{id}', 'DummyController@find'); |
|
| 20 | + Route::post('/', 'DummyController@insert'); |
|
| 21 | + Route::put('/', 'DummyController@update'); |
|
| 22 | + Route::delete('/{id}', 'DummyController@delete'); |
|
| 23 | + Route::get('list/deleted', 'DummyController@deleted'); |
|
| 24 | + Route::patch('restore/{id}', 'DummyController@restore'); |
|
| 25 | 25 | }); |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | |
| 7 | 7 | class NotificationsDatabaseSeeder extends Seeder |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the database seeds. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function run() |
|
| 15 | - { |
|
| 16 | - $this->call(ClearDataSeeder::class); |
|
| 17 | - $this->call(NotificationsTableSeeder::class); |
|
| 18 | - $this->call(AssignRelationsSeeder::class); |
|
| 19 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + $this->call(ClearDataSeeder::class); |
|
| 17 | + $this->call(NotificationsTableSeeder::class); |
|
| 18 | + $this->call(AssignRelationsSeeder::class); |
|
| 19 | + } |
|
| 20 | 20 | } |