Completed
Push — master ( 91df31...876b8b )
by Sherif
01:12
created
src/Modules/Core/Http/Requests/StoreSetting.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@
 block discarded – undo
6 6
 
7 7
 class StoreSetting 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
-            'value' => 'required|string'
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
+			'value' => 'required|string'
28
+		];
29
+	}
30 30
 }
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/Stubs/Module/Routes/api.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@
 block discarded – undo
15 15
 
16 16
 Route::group(['prefix' => 'DummyRoutePrefix'], function () {
17 17
 
18
-    Route::get('/', 'DummyController@index');
19
-    Route::get('{id}', 'DummyController@show');
20
-    Route::post('/', 'DummyController@store');
21
-    Route::patch('{id}', 'DummyController@update');
22
-    Route::delete('{id}', 'DummyController@destroy');
23
-    Route::patch('restore/{id}', 'DummyController@restore');
18
+	Route::get('/', 'DummyController@index');
19
+	Route::get('{id}', 'DummyController@show');
20
+	Route::post('/', 'DummyController@store');
21
+	Route::patch('{id}', 'DummyController@update');
22
+	Route::delete('{id}', 'DummyController@destroy');
23
+	Route::patch('restore/{id}', 'DummyController@restore');
24 24
 });
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Controllers/RoleController.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -10,40 +10,40 @@
 block discarded – undo
10 10
 
11 11
 class RoleController extends BaseApiController
12 12
 {
13
-    /**
14
-     * Path of the sotre form request.
15
-     *
16
-     * @var string
17
-     */
18
-    protected $storeFormRequest = 'App\Modules\Roles\Http\Requests\StoreRole';
13
+	/**
14
+	 * Path of the sotre form request.
15
+	 *
16
+	 * @var string
17
+	 */
18
+	protected $storeFormRequest = 'App\Modules\Roles\Http\Requests\StoreRole';
19 19
 
20
-    /**
21
-     * Path of the model resource
22
-     *
23
-     * @var string
24
-     */
25
-    protected $modelResource = 'App\Modules\Roles\Http\Resources\Role';
20
+	/**
21
+	 * Path of the model resource
22
+	 *
23
+	 * @var string
24
+	 */
25
+	protected $modelResource = 'App\Modules\Roles\Http\Resources\Role';
26 26
 
27
-    /**
28
-     * Init new object.
29
-     *
30
-     * @param   RoleService $service
31
-     * @return  void
32
-     */
33
-    public function __construct(RoleService $service)
34
-    {
35
-        parent::__construct($service);
36
-    }
27
+	/**
28
+	 * Init new object.
29
+	 *
30
+	 * @param   RoleService $service
31
+	 * @return  void
32
+	 */
33
+	public function __construct(RoleService $service)
34
+	{
35
+		parent::__construct($service);
36
+	}
37 37
 
38
-    /**
39
-     * Handle an assign permissions to role request.
40
-     *
41
-     * @param  AssignPermissions $request
42
-     * @param  integer           $id
43
-     * @return \Illuminate\Http\Response
44
-     */
45
-    public function assignPermissions(AssignPermissions $request, $id)
46
-    {
47
-        return new $this->modelResource($this->service->assignPermissions($id, $request->get('permission_ids')));
48
-    }
38
+	/**
39
+	 * Handle an assign permissions to role request.
40
+	 *
41
+	 * @param  AssignPermissions $request
42
+	 * @param  integer           $id
43
+	 * @return \Illuminate\Http\Response
44
+	 */
45
+	public function assignPermissions(AssignPermissions $request, $id)
46
+	{
47
+		return new $this->modelResource($this->service->assignPermissions($id, $request->get('permission_ids')));
48
+	}
49 49
 }
Please login to merge, or discard this patch.
files/Kernel.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -11,39 +11,39 @@
 block discarded – undo
11 11
 
12 12
 class Kernel extends ConsoleKernel
13 13
 {
14
-    /**
15
-     * The Artisan commands provided by your application.
16
-     *
17
-     * @var array
18
-     */
19
-    protected $commands = [
20
-        GenerateDocCommand::class,
21
-        PassportInstallCommand::class,
22
-        MakeNotificationsCommand::class,
23
-        MakeModuleCommand::class
24
-    ];
14
+	/**
15
+	 * The Artisan commands provided by your application.
16
+	 *
17
+	 * @var array
18
+	 */
19
+	protected $commands = [
20
+		GenerateDocCommand::class,
21
+		PassportInstallCommand::class,
22
+		MakeNotificationsCommand::class,
23
+		MakeModuleCommand::class
24
+	];
25 25
 
26
-    /**
27
-     * Define the application's command schedule.
28
-     *
29
-     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
30
-     * @return void
31
-     */
32
-    protected function schedule(Schedule $schedule)
33
-    {
34
-        // $schedule->command('inspire')
35
-        //          ->hourly();
36
-    }
26
+	/**
27
+	 * Define the application's command schedule.
28
+	 *
29
+	 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
30
+	 * @return void
31
+	 */
32
+	protected function schedule(Schedule $schedule)
33
+	{
34
+		// $schedule->command('inspire')
35
+		//          ->hourly();
36
+	}
37 37
 
38
-    /**
39
-     * Register the commands for the application.
40
-     *
41
-     * @return void
42
-     */
43
-    protected function commands()
44
-    {
45
-        $this->load(__DIR__.'/Commands');
38
+	/**
39
+	 * Register the commands for the application.
40
+	 *
41
+	 * @return void
42
+	 */
43
+	protected function commands()
44
+	{
45
+		$this->load(__DIR__.'/Commands');
46 46
 
47
-        require base_path('routes/console.php');
48
-    }
47
+		require base_path('routes/console.php');
48
+	}
49 49
 }
Please login to merge, or discard this patch.
Modules/Permissions/Database/Migrations/2016_01_05_130506_permissions.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -5,41 +5,41 @@
 block discarded – undo
5 5
 
6 6
 class Permissions extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('permissions', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('name', 100);
18
-            $table->string('model', 100);
19
-            $table->softDeletes();
20
-            $table->timestamps();
21
-            $table->unique(array('name', 'model'));
22
-        });
23
-        Schema::create('permission_role', function (Blueprint $table) {
24
-            $table->increments('id');
25
-            $table->unsignedInteger('role_id');
26
-            $table->unsignedInteger('permission_id');
27
-            $table->softDeletes();
28
-            $table->timestamps();
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('permissions', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('name', 100);
18
+			$table->string('model', 100);
19
+			$table->softDeletes();
20
+			$table->timestamps();
21
+			$table->unique(array('name', 'model'));
22
+		});
23
+		Schema::create('permission_role', function (Blueprint $table) {
24
+			$table->increments('id');
25
+			$table->unsignedInteger('role_id');
26
+			$table->unsignedInteger('permission_id');
27
+			$table->softDeletes();
28
+			$table->timestamps();
29 29
 
30
-            $table->foreign('role_id')->references('id')->on('roles');
31
-            $table->foreign('permission_id')->references('id')->on('permissions');
32
-        });
33
-    }
30
+			$table->foreign('role_id')->references('id')->on('roles');
31
+			$table->foreign('permission_id')->references('id')->on('permissions');
32
+		});
33
+	}
34 34
 
35
-    /**
36
-     * Reverse the migrations.
37
-     *
38
-     * @return void
39
-     */
40
-    public function down()
41
-    {
42
-        Schema::dropIfExists('permission_role');
43
-        Schema::dropIfExists('permissions');
44
-    }
35
+	/**
36
+	 * Reverse the migrations.
37
+	 *
38
+	 * @return void
39
+	 */
40
+	public function down()
41
+	{
42
+		Schema::dropIfExists('permission_role');
43
+		Schema::dropIfExists('permissions');
44
+	}
45 45
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Migrations/2015_12_22_145819_roles.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -5,40 +5,40 @@
 block discarded – undo
5 5
 
6 6
 class Roles extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('roles', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('name', 100)->unique();
18
-            $table->softDeletes();
19
-            $table->timestamps();
20
-        });
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('roles', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('name', 100)->unique();
18
+			$table->softDeletes();
19
+			$table->timestamps();
20
+		});
21 21
         
22
-        Schema::create('role_user', function (Blueprint $table) {
23
-            $table->increments('id');
24
-            $table->unsignedInteger('user_id');
25
-            $table->unsignedInteger('role_id');
26
-            $table->softDeletes();
27
-            $table->timestamps();
22
+		Schema::create('role_user', function (Blueprint $table) {
23
+			$table->increments('id');
24
+			$table->unsignedInteger('user_id');
25
+			$table->unsignedInteger('role_id');
26
+			$table->softDeletes();
27
+			$table->timestamps();
28 28
 
29
-            $table->foreign('user_id')->references('id')->on('users');
30
-            $table->foreign('role_id')->references('id')->on('roles');
31
-        });
32
-    }
29
+			$table->foreign('user_id')->references('id')->on('users');
30
+			$table->foreign('role_id')->references('id')->on('roles');
31
+		});
32
+	}
33 33
 
34
-    /**
35
-     * Reverse the migrations.
36
-     *
37
-     * @return void
38
-     */
39
-    public function down()
40
-    {
41
-        Schema::dropIfExists('role_user');
42
-        Schema::dropIfExists('roles');
43
-    }
34
+	/**
35
+	 * Reverse the migrations.
36
+	 *
37
+	 * @return void
38
+	 */
39
+	public function down()
40
+	{
41
+		Schema::dropIfExists('role_user');
42
+		Schema::dropIfExists('roles');
43
+	}
44 44
 }
Please login to merge, or discard this patch.
src/Modules/Users/Proxy/LoginProxy.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -7,64 +7,64 @@
 block discarded – undo
7 7
 
8 8
 class LoginProxy
9 9
 {
10
-    /**
11
-     * Attempt to create an access token using user credentials.
12
-     *
13
-     * @param  string  $email
14
-     * @param  string  $password
15
-     * @return array
16
-     */
17
-    public function login($email, $password)
18
-    {
19
-        return $this->proxy('password', [
20
-            'username' => $email,
21
-            'password' => $password
22
-        ]);
23
-    }
10
+	/**
11
+	 * Attempt to create an access token using user credentials.
12
+	 *
13
+	 * @param  string  $email
14
+	 * @param  string  $password
15
+	 * @return array
16
+	 */
17
+	public function login($email, $password)
18
+	{
19
+		return $this->proxy('password', [
20
+			'username' => $email,
21
+			'password' => $password
22
+		]);
23
+	}
24 24
 
25
-    /**
26
-     * Attempt to refresh the access token using the given refresh token.
27
-     *
28
-     * @param  string $refreshToken
29
-     * @return array
30
-     */
31
-    public function refreshToken($refreshToken)
32
-    {
33
-        return $this->proxy('refresh_token', [
34
-            'refresh_token' => $refreshToken
35
-        ]);
36
-    }
25
+	/**
26
+	 * Attempt to refresh the access token using the given refresh token.
27
+	 *
28
+	 * @param  string $refreshToken
29
+	 * @return array
30
+	 */
31
+	public function refreshToken($refreshToken)
32
+	{
33
+		return $this->proxy('refresh_token', [
34
+			'refresh_token' => $refreshToken
35
+		]);
36
+	}
37 37
 
38
-    /**
39
-     * Proxy a request to the OAuth server.
40
-     *
41
-     * @param string $grantType what type of grant type should be proxied
42
-     * @param array
43
-     */
44
-    public function proxy($grantType, array $data = [])
45
-    {
46
-        $data = array_merge($data, [
47
-            'client_id'     => config('user.passport_client_id'),
48
-            'client_secret' => config('user.passport_client_secret'),
49
-            'grant_type'    => $grantType
50
-        ]);
38
+	/**
39
+	 * Proxy a request to the OAuth server.
40
+	 *
41
+	 * @param string $grantType what type of grant type should be proxied
42
+	 * @param array
43
+	 */
44
+	public function proxy($grantType, array $data = [])
45
+	{
46
+		$data = array_merge($data, [
47
+			'client_id'     => config('user.passport_client_id'),
48
+			'client_secret' => config('user.passport_client_secret'),
49
+			'grant_type'    => $grantType
50
+		]);
51 51
 
52
-        $response = \ApiConsumer::post('/oauth/token', $data);
52
+		$response = \ApiConsumer::post('/oauth/token', $data);
53 53
 
54
-        if (! $response->isSuccessful()) {
55
-            if ($grantType == 'refresh_token') {
56
-                \Errors::invalidRefreshToken();
57
-            }
54
+		if (! $response->isSuccessful()) {
55
+			if ($grantType == 'refresh_token') {
56
+				\Errors::invalidRefreshToken();
57
+			}
58 58
 
59
-            \Errors::loginFailed();
60
-        }
59
+			\Errors::loginFailed();
60
+		}
61 61
 
62
-        $data = json_decode($response->getContent());
62
+		$data = json_decode($response->getContent());
63 63
 
64
-        return [
65
-            'access_token'  => $data->access_token,
66
-            'refresh_token' => $data->refresh_token,
67
-            'expires_in'    => $data->expires_in
68
-        ];
69
-    }
64
+		return [
65
+			'access_token'  => $data->access_token,
66
+			'refresh_token' => $data->refresh_token,
67
+			'expires_in'    => $data->expires_in
68
+		];
69
+	}
70 70
 }
Please login to merge, or discard this patch.
src/Modules/Core/Errors/Errors.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,28 +6,28 @@
 block discarded – undo
6 6
 
7 7
 class Errors implements BaseFactoryInterface
8 8
 {
9
-    /**
10
-     * Construct the config class name based on
11
-     * the method name called, search in the
12
-     * given namespaces for the class and
13
-     * return an instance.
14
-     *
15
-     * @param  string $name the called method name
16
-     * @param  array  $arguments the method arguments
17
-     * @return object
18
-     */
19
-    public function __call($name, $arguments)
20
-    {
21
-        foreach (\Module::all() as $module) {
22
-            $nameSpace = 'App\\Modules\\' . $module['basename'];
23
-            $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors';
9
+	/**
10
+	 * Construct the config class name based on
11
+	 * the method name called, search in the
12
+	 * given namespaces for the class and
13
+	 * return an instance.
14
+	 *
15
+	 * @param  string $name the called method name
16
+	 * @param  array  $arguments the method arguments
17
+	 * @return object
18
+	 */
19
+	public function __call($name, $arguments)
20
+	{
21
+		foreach (\Module::all() as $module) {
22
+			$nameSpace = 'App\\Modules\\' . $module['basename'];
23
+			$class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors';
24 24
 
25
-            if (class_exists($class)) {
26
-                $class = \App::make($class);
27
-                if (method_exists($class, $name)) {
28
-                    return call_user_func_array([$class, $name], $arguments);
29
-                }
30
-            }
31
-        }
32
-    }
25
+			if (class_exists($class)) {
26
+				$class = \App::make($class);
27
+				if (method_exists($class, $name)) {
28
+					return call_user_func_array([$class, $name], $arguments);
29
+				}
30
+			}
31
+		}
32
+	}
33 33
 }
Please login to merge, or discard this patch.
src/Modules/Core/Routes/web.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 if (\App::environment('local')) {
14
-    Route::get('/docs', 'ApiDocumentController@index');
14
+	Route::get('/docs', 'ApiDocumentController@index');
15 15
 }
Please login to merge, or discard this patch.