@@ -6,28 +6,28 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateOauthRefreshTokensTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('oauth_refresh_tokens', function (Blueprint $table) { |
|
| 17 | - $table->string('id', 100)->primary(); |
|
| 18 | - $table->string('access_token_id', 100)->index(); |
|
| 19 | - $table->boolean('revoked'); |
|
| 20 | - $table->dateTime('expires_at')->nullable(); |
|
| 21 | - }); |
|
| 22 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('oauth_refresh_tokens', function (Blueprint $table) { |
|
| 17 | + $table->string('id', 100)->primary(); |
|
| 18 | + $table->string('access_token_id', 100)->index(); |
|
| 19 | + $table->boolean('revoked'); |
|
| 20 | + $table->dateTime('expires_at')->nullable(); |
|
| 21 | + }); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Reverse the migrations. |
|
| 26 | - * |
|
| 27 | - * @return void |
|
| 28 | - */ |
|
| 29 | - public function down() |
|
| 30 | - { |
|
| 31 | - Schema::drop('oauth_refresh_tokens'); |
|
| 32 | - } |
|
| 24 | + /** |
|
| 25 | + * Reverse the migrations. |
|
| 26 | + * |
|
| 27 | + * @return void |
|
| 28 | + */ |
|
| 29 | + public function down() |
|
| 30 | + { |
|
| 31 | + Schema::drop('oauth_refresh_tokens'); |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('oauth_refresh_tokens', function (Blueprint $table) { |
|
| 16 | + Schema::create('oauth_refresh_tokens', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('id', 100)->primary(); |
| 18 | 18 | $table->string('access_token_id', 100)->index(); |
| 19 | 19 | $table->boolean('revoked'); |
@@ -6,32 +6,32 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateOauthAccessTokensTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('oauth_access_tokens', function (Blueprint $table) { |
|
| 17 | - $table->string('id', 100)->primary(); |
|
| 18 | - $table->integer('user_id')->index()->nullable(); |
|
| 19 | - $table->integer('client_id'); |
|
| 20 | - $table->string('name')->nullable(); |
|
| 21 | - $table->text('scopes')->nullable(); |
|
| 22 | - $table->boolean('revoked'); |
|
| 23 | - $table->timestamps(); |
|
| 24 | - $table->dateTime('expires_at')->nullable(); |
|
| 25 | - }); |
|
| 26 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('oauth_access_tokens', function (Blueprint $table) { |
|
| 17 | + $table->string('id', 100)->primary(); |
|
| 18 | + $table->integer('user_id')->index()->nullable(); |
|
| 19 | + $table->integer('client_id'); |
|
| 20 | + $table->string('name')->nullable(); |
|
| 21 | + $table->text('scopes')->nullable(); |
|
| 22 | + $table->boolean('revoked'); |
|
| 23 | + $table->timestamps(); |
|
| 24 | + $table->dateTime('expires_at')->nullable(); |
|
| 25 | + }); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Reverse the migrations. |
|
| 30 | - * |
|
| 31 | - * @return void |
|
| 32 | - */ |
|
| 33 | - public function down() |
|
| 34 | - { |
|
| 35 | - Schema::drop('oauth_access_tokens'); |
|
| 36 | - } |
|
| 28 | + /** |
|
| 29 | + * Reverse the migrations. |
|
| 30 | + * |
|
| 31 | + * @return void |
|
| 32 | + */ |
|
| 33 | + public function down() |
|
| 34 | + { |
|
| 35 | + Schema::drop('oauth_access_tokens'); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('oauth_access_tokens', function (Blueprint $table) { |
|
| 16 | + Schema::create('oauth_access_tokens', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('id', 100)->primary(); |
| 18 | 18 | $table->integer('user_id')->index()->nullable(); |
| 19 | 19 | $table->integer('client_id'); |
@@ -6,33 +6,33 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateOauthClientsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('oauth_clients', function (Blueprint $table) { |
|
| 17 | - $table->increments('id'); |
|
| 18 | - $table->integer('user_id')->index()->nullable(); |
|
| 19 | - $table->string('name'); |
|
| 20 | - $table->string('secret', 100); |
|
| 21 | - $table->text('redirect'); |
|
| 22 | - $table->boolean('personal_access_client')->default(0); |
|
| 23 | - $table->boolean('password_client')->default(0); |
|
| 24 | - $table->boolean('revoked')->default(0); |
|
| 25 | - $table->timestamps(); |
|
| 26 | - }); |
|
| 27 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('oauth_clients', function (Blueprint $table) { |
|
| 17 | + $table->increments('id'); |
|
| 18 | + $table->integer('user_id')->index()->nullable(); |
|
| 19 | + $table->string('name'); |
|
| 20 | + $table->string('secret', 100); |
|
| 21 | + $table->text('redirect'); |
|
| 22 | + $table->boolean('personal_access_client')->default(0); |
|
| 23 | + $table->boolean('password_client')->default(0); |
|
| 24 | + $table->boolean('revoked')->default(0); |
|
| 25 | + $table->timestamps(); |
|
| 26 | + }); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Reverse the migrations. |
|
| 31 | - * |
|
| 32 | - * @return void |
|
| 33 | - */ |
|
| 34 | - public function down() |
|
| 35 | - { |
|
| 36 | - Schema::drop('oauth_clients'); |
|
| 37 | - } |
|
| 29 | + /** |
|
| 30 | + * Reverse the migrations. |
|
| 31 | + * |
|
| 32 | + * @return void |
|
| 33 | + */ |
|
| 34 | + public function down() |
|
| 35 | + { |
|
| 36 | + Schema::drop('oauth_clients'); |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('oauth_clients', function (Blueprint $table) { |
|
| 16 | + Schema::create('oauth_clients', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->integer('user_id')->index()->nullable(); |
| 19 | 19 | $table->string('name'); |
@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateOauthPersonalAccessClientsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('oauth_personal_access_clients', function (Blueprint $table) { |
|
| 17 | - $table->increments('id'); |
|
| 18 | - $table->integer('client_id')->index(); |
|
| 19 | - $table->timestamps(); |
|
| 20 | - }); |
|
| 21 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('oauth_personal_access_clients', function (Blueprint $table) { |
|
| 17 | + $table->increments('id'); |
|
| 18 | + $table->integer('client_id')->index(); |
|
| 19 | + $table->timestamps(); |
|
| 20 | + }); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Reverse the migrations. |
|
| 25 | - * |
|
| 26 | - * @return void |
|
| 27 | - */ |
|
| 28 | - public function down() |
|
| 29 | - { |
|
| 30 | - Schema::drop('oauth_personal_access_clients'); |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * Reverse the migrations. |
|
| 25 | + * |
|
| 26 | + * @return void |
|
| 27 | + */ |
|
| 28 | + public function down() |
|
| 29 | + { |
|
| 30 | + Schema::drop('oauth_personal_access_clients'); |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('oauth_personal_access_clients', function (Blueprint $table) { |
|
| 16 | + Schema::create('oauth_personal_access_clients', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->integer('client_id')->index(); |
| 19 | 19 | $table->timestamps(); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $factory->define(App\Modules\Acl\OauthClient::class, function (Faker\Generator $faker) { |
| 4 | - return [ |
|
| 5 | - 'user_id' => $faker->randomDigit(), |
|
| 4 | + return [ |
|
| 5 | + 'user_id' => $faker->randomDigit(), |
|
| 6 | 6 | 'name' => $faker->name(), |
| 7 | 7 | 'secret' => str_random(40), |
| 8 | 8 | 'redirect' => $faker->url(), |
@@ -11,5 +11,5 @@ discard block |
||
| 11 | 11 | 'revoked' => $faker->boolean(), |
| 12 | 12 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
| 13 | 13 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
| 14 | - ]; |
|
| 14 | + ]; |
|
| 15 | 15 | }); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Acl\OauthClient::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Acl\OauthClient::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'user_id' => $faker->randomDigit(), |
| 6 | 6 | 'name' => $faker->name(), |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $factory->define(App\Modules\Acl\AclUser::class, function (Faker\Generator $faker) { |
| 4 | - return [ |
|
| 4 | + return [ |
|
| 5 | 5 | 'profile_picture' => 'http://lorempixel.com/400/200/', |
| 6 | 6 | 'name' => $faker->name(), |
| 7 | 7 | 'email' => $faker->safeEmail(), |
| 8 | 8 | 'password' => 123456, |
| 9 | 9 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
| 10 | 10 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
| 11 | - ]; |
|
| 11 | + ]; |
|
| 12 | 12 | }); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Acl\AclUser::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Acl\AclUser::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'profile_picture' => 'http://lorempixel.com/400/200/', |
| 6 | 6 | 'name' => $faker->name(), |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $factory->define(App\Modules\Acl\AclGroup::class, function (Faker\Generator $faker) { |
| 4 | - return [ |
|
| 4 | + return [ |
|
| 5 | 5 | 'name' => $faker->unique->word(), |
| 6 | 6 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
| 7 | 7 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
| 8 | - ]; |
|
| 8 | + ]; |
|
| 9 | 9 | }); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Acl\AclGroup::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Acl\AclGroup::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'name' => $faker->unique->word(), |
| 6 | 6 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $factory->define(App\Modules\Acl\AclPermission::class, function (Faker\Generator $faker) { |
| 4 | - return [ |
|
| 4 | + return [ |
|
| 5 | 5 | 'name' => $faker->randomElement(['save', 'delete', 'find', 'paginate']), |
| 6 | 6 | 'model' => $faker->randomElement(['users', 'groups', 'settings', 'notifications']), |
| 7 | 7 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
| 8 | 8 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
| 9 | - ]; |
|
| 9 | + ]; |
|
| 10 | 10 | }); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Acl\AclPermission::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Acl\AclPermission::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'name' => $faker->randomElement(['save', 'delete', 'find', 'paginate']), |
| 6 | 6 | 'model' => $faker->randomElement(['users', 'groups', 'settings', 'notifications']), |
@@ -8,44 +8,44 @@ |
||
| 8 | 8 | |
| 9 | 9 | class OauthClientsController extends BaseApiController |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * The name of the model that is used by the base api controller |
|
| 13 | - * to preform actions like (add, edit ... etc). |
|
| 14 | - * @var string |
|
| 15 | - */ |
|
| 16 | - protected $model = 'oauthClients'; |
|
| 11 | + /** |
|
| 12 | + * The name of the model that is used by the base api controller |
|
| 13 | + * to preform actions like (add, edit ... etc). |
|
| 14 | + * @var string |
|
| 15 | + */ |
|
| 16 | + protected $model = 'oauthClients'; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * The validations rules used by the base api controller |
|
| 20 | - * to check before add. |
|
| 21 | - * @var array |
|
| 22 | - */ |
|
| 23 | - protected $validationRules = [ |
|
| 24 | - 'name' => 'required|max:255', |
|
| 25 | - 'redirect' => 'required|url', |
|
| 26 | - 'user_id' => 'required|exists:users,id', |
|
| 27 | - 'revoked' => 'boolean' |
|
| 28 | - ]; |
|
| 18 | + /** |
|
| 19 | + * The validations rules used by the base api controller |
|
| 20 | + * to check before add. |
|
| 21 | + * @var array |
|
| 22 | + */ |
|
| 23 | + protected $validationRules = [ |
|
| 24 | + 'name' => 'required|max:255', |
|
| 25 | + 'redirect' => 'required|url', |
|
| 26 | + 'user_id' => 'required|exists:users,id', |
|
| 27 | + 'revoked' => 'boolean' |
|
| 28 | + ]; |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Revoke the given client. |
|
| 32 | - * |
|
| 33 | - * @param integer $clientId Id of the client |
|
| 34 | - * @return \Illuminate\Http\Response |
|
| 35 | - */ |
|
| 36 | - public function revoke($clientId) |
|
| 37 | - { |
|
| 38 | - return \Response::json($this->repo->revoke($clientId), 200); |
|
| 39 | - } |
|
| 30 | + /** |
|
| 31 | + * Revoke the given client. |
|
| 32 | + * |
|
| 33 | + * @param integer $clientId Id of the client |
|
| 34 | + * @return \Illuminate\Http\Response |
|
| 35 | + */ |
|
| 36 | + public function revoke($clientId) |
|
| 37 | + { |
|
| 38 | + return \Response::json($this->repo->revoke($clientId), 200); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Un revoke the given client. |
|
| 43 | - * |
|
| 44 | - * @param integer $clientId Id of the client |
|
| 45 | - * @return \Illuminate\Http\Response |
|
| 46 | - */ |
|
| 47 | - public function unRevoke($clientId) |
|
| 48 | - { |
|
| 49 | - return \Response::json($this->repo->unRevoke($clientId), 200); |
|
| 50 | - } |
|
| 41 | + /** |
|
| 42 | + * Un revoke the given client. |
|
| 43 | + * |
|
| 44 | + * @param integer $clientId Id of the client |
|
| 45 | + * @return \Illuminate\Http\Response |
|
| 46 | + */ |
|
| 47 | + public function unRevoke($clientId) |
|
| 48 | + { |
|
| 49 | + return \Response::json($this->repo->unRevoke($clientId), 200); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | * to preform actions like (add, edit ... etc). |
| 14 | 14 | * @var string |
| 15 | 15 | */ |
| 16 | - protected $model = 'oauthClients'; |
|
| 16 | + protected $model = 'oauthClients'; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * The validations rules used by the base api controller |
| 20 | 20 | * to check before add. |
| 21 | 21 | * @var array |
| 22 | 22 | */ |
| 23 | - protected $validationRules = [ |
|
| 23 | + protected $validationRules = [ |
|
| 24 | 24 | 'name' => 'required|max:255', |
| 25 | 25 | 'redirect' => 'required|url', |
| 26 | 26 | 'user_id' => 'required|exists:users,id', |