@@ -8,53 +8,53 @@ |
||
| 8 | 8 | class OauthClientObserver |
| 9 | 9 | { |
| 10 | 10 | |
| 11 | - public function saving($model) |
|
| 12 | - { |
|
| 13 | - // |
|
| 14 | - } |
|
| 15 | - |
|
| 16 | - public function saved($model) |
|
| 17 | - { |
|
| 18 | - // |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - public function creating($model) |
|
| 22 | - { |
|
| 23 | - $model->secret = Str::random(40); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function created($model) |
|
| 27 | - { |
|
| 28 | - // |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - public function updating($model) |
|
| 32 | - { |
|
| 33 | - // |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - public function updated($model) |
|
| 37 | - { |
|
| 38 | - // |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public function deleting($model) |
|
| 42 | - { |
|
| 43 | - // |
|
| 44 | - } |
|
| 45 | - |
|
| 46 | - public function deleted($model) |
|
| 47 | - { |
|
| 48 | - // |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - public function restoring($model) |
|
| 52 | - { |
|
| 53 | - // |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - public function restored($model) |
|
| 57 | - { |
|
| 58 | - // |
|
| 59 | - } |
|
| 11 | + public function saving($model) |
|
| 12 | + { |
|
| 13 | + // |
|
| 14 | + } |
|
| 15 | + |
|
| 16 | + public function saved($model) |
|
| 17 | + { |
|
| 18 | + // |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + public function creating($model) |
|
| 22 | + { |
|
| 23 | + $model->secret = Str::random(40); |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function created($model) |
|
| 27 | + { |
|
| 28 | + // |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + public function updating($model) |
|
| 32 | + { |
|
| 33 | + // |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + public function updated($model) |
|
| 37 | + { |
|
| 38 | + // |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public function deleting($model) |
|
| 42 | + { |
|
| 43 | + // |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + public function deleted($model) |
|
| 47 | + { |
|
| 48 | + // |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + public function restoring($model) |
|
| 52 | + { |
|
| 53 | + // |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + public function restored($model) |
|
| 57 | + { |
|
| 58 | + // |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -7,73 +7,73 @@ |
||
| 7 | 7 | |
| 8 | 8 | class RouteServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 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\OauthClients\Http\Controllers'; |
|
| 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\OauthClients\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('oauth-clients', 'Routes/web.php', 'app'); |
|
| 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('oauth-clients', 'Routes/web.php', 'app'); |
|
| 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('oauth-clients', 'Routes/api.php', 'app'); |
|
| 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('oauth-clients', 'Routes/api.php', 'app'); |
|
| 77 | + }); |
|
| 78 | + } |
|
| 79 | 79 | } |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $factory->define(App\Modules\OauthClients\OauthClient::class, function (Faker\Generator $faker) { |
| 4 | - return [ |
|
| 5 | - 'user_id' => $faker->randomDigit(), |
|
| 6 | - 'name' => $faker->name(), |
|
| 7 | - 'secret' => \Illuminate\Support\Str::random(40), |
|
| 8 | - 'redirect' => $faker->url(), |
|
| 9 | - 'personal_access_client' => 0, |
|
| 10 | - 'password_client' => 0, |
|
| 11 | - 'revoked' => $faker->boolean(), |
|
| 12 | - 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
|
| 13 | - 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
|
| 14 | - ]; |
|
| 4 | + return [ |
|
| 5 | + 'user_id' => $faker->randomDigit(), |
|
| 6 | + 'name' => $faker->name(), |
|
| 7 | + 'secret' => \Illuminate\Support\Str::random(40), |
|
| 8 | + 'redirect' => $faker->url(), |
|
| 9 | + 'personal_access_client' => 0, |
|
| 10 | + 'password_client' => 0, |
|
| 11 | + 'revoked' => $faker->boolean(), |
|
| 12 | + 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
|
| 13 | + 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
|
| 14 | + ]; |
|
| 15 | 15 | }); |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | |
| 7 | 7 | class OauthClientsDatabaseSeeder 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(OauthClientsTableSeeder::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(OauthClientsTableSeeder::class); |
|
| 18 | + $this->call(AssignRelationsSeeder::class); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -7,28 +7,28 @@ |
||
| 7 | 7 | |
| 8 | 8 | class OauthClient extends JsonResource |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Transform the resource into an array. |
|
| 12 | - * |
|
| 13 | - * @param Request $request |
|
| 14 | - * @return array |
|
| 15 | - */ |
|
| 16 | - public function toArray($request) |
|
| 17 | - { |
|
| 18 | - if (! $this->resource) { |
|
| 19 | - return []; |
|
| 20 | - } |
|
| 10 | + /** |
|
| 11 | + * Transform the resource into an array. |
|
| 12 | + * |
|
| 13 | + * @param Request $request |
|
| 14 | + * @return array |
|
| 15 | + */ |
|
| 16 | + public function toArray($request) |
|
| 17 | + { |
|
| 18 | + if (! $this->resource) { |
|
| 19 | + return []; |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - return [ |
|
| 23 | - 'id' => $this->id, |
|
| 24 | - 'name' => $this->name, |
|
| 25 | - 'redirect' => $this->redirect, |
|
| 26 | - 'user' => new UserResource($this->whenLoaded('user')), |
|
| 27 | - 'personalAccessClient' => $this->personal_access_client, |
|
| 28 | - 'passwordClient' => $this->password_client, |
|
| 29 | - 'revoked' => $this->revoked, |
|
| 30 | - 'created_at' => $this->created_at, |
|
| 31 | - 'updated_at' => $this->updated_at, |
|
| 32 | - ]; |
|
| 33 | - } |
|
| 22 | + return [ |
|
| 23 | + 'id' => $this->id, |
|
| 24 | + 'name' => $this->name, |
|
| 25 | + 'redirect' => $this->redirect, |
|
| 26 | + 'user' => new UserResource($this->whenLoaded('user')), |
|
| 27 | + 'personalAccessClient' => $this->personal_access_client, |
|
| 28 | + 'passwordClient' => $this->password_client, |
|
| 29 | + 'revoked' => $this->revoked, |
|
| 30 | + 'created_at' => $this->created_at, |
|
| 31 | + 'updated_at' => $this->updated_at, |
|
| 32 | + ]; |
|
| 33 | + } |
|
| 34 | 34 | } |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Notification 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 | - 'type' => $this->type, |
|
| 24 | - 'data' => $this->data, |
|
| 25 | - 'read_at' => $this->read_at, |
|
| 26 | - 'created_at' => $this->created_at, |
|
| 27 | - 'updated_at' => $this->updated_at, |
|
| 28 | - ]; |
|
| 29 | - } |
|
| 21 | + return [ |
|
| 22 | + 'id' => $this->id, |
|
| 23 | + 'type' => $this->type, |
|
| 24 | + 'data' => $this->data, |
|
| 25 | + 'read_at' => $this->read_at, |
|
| 26 | + 'created_at' => $this->created_at, |
|
| 27 | + 'updated_at' => $this->updated_at, |
|
| 28 | + ]; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -6,32 +6,32 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Setting extends JsonResource |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Indicates if the resource's collection keys should be preserved. |
|
| 11 | - * |
|
| 12 | - * @var bool |
|
| 13 | - */ |
|
| 14 | - public $preserveKeys = true; |
|
| 9 | + /** |
|
| 10 | + * Indicates if the resource's collection keys should be preserved. |
|
| 11 | + * |
|
| 12 | + * @var bool |
|
| 13 | + */ |
|
| 14 | + public $preserveKeys = true; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Transform the resource into an array. |
|
| 18 | - * |
|
| 19 | - * @param Request $request |
|
| 20 | - * @return array |
|
| 21 | - */ |
|
| 22 | - public function toArray($request) |
|
| 23 | - { |
|
| 24 | - if (! $this->resource) { |
|
| 25 | - return []; |
|
| 26 | - } |
|
| 16 | + /** |
|
| 17 | + * Transform the resource into an array. |
|
| 18 | + * |
|
| 19 | + * @param Request $request |
|
| 20 | + * @return array |
|
| 21 | + */ |
|
| 22 | + public function toArray($request) |
|
| 23 | + { |
|
| 24 | + if (! $this->resource) { |
|
| 25 | + return []; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - return [ |
|
| 29 | - 'id' => $this->id, |
|
| 30 | - 'name' => $this->name, |
|
| 31 | - 'value' => $this->value, |
|
| 32 | - 'key' => $this->key, |
|
| 33 | - 'created_at' => $this->created_at, |
|
| 34 | - 'updated_at' => $this->updated_at, |
|
| 35 | - ]; |
|
| 36 | - } |
|
| 28 | + return [ |
|
| 29 | + 'id' => $this->id, |
|
| 30 | + 'name' => $this->name, |
|
| 31 | + 'value' => $this->value, |
|
| 32 | + 'key' => $this->key, |
|
| 33 | + 'created_at' => $this->created_at, |
|
| 34 | + 'updated_at' => $this->updated_at, |
|
| 35 | + ]; |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -6,24 +6,24 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Report 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 | - 'report_name' => $this->report_name, |
|
| 24 | - 'view_name' => $this->view_name, |
|
| 25 | - 'created_at' => $this->created_at, |
|
| 26 | - 'updated_at' => $this->updated_at, |
|
| 27 | - ]; |
|
| 28 | - } |
|
| 21 | + return [ |
|
| 22 | + 'id' => $this->id, |
|
| 23 | + 'report_name' => $this->report_name, |
|
| 24 | + 'view_name' => $this->view_name, |
|
| 25 | + 'created_at' => $this->created_at, |
|
| 26 | + 'updated_at' => $this->updated_at, |
|
| 27 | + ]; |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DummyDatabaseSeeder 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(DummyTableSeeder::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(DummyTableSeeder::class); |
|
| 18 | + $this->call(AssignRelationsSeeder::class); |
|
| 19 | + } |
|
| 20 | 20 | } |