Completed
Push — master ( fed21d...0c3b23 )
by Sherif
10:50
created
src/Modules/Core/Database/Migrations/2016_01_24_123630_settings.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -5,30 +5,30 @@
 block discarded – undo
5 5
 
6 6
 class Settings extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('settings', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('name', 100);
18
-            $table->string('key', 100)->unique();
19
-            $table->text('value')->nullable();
20
-            $table->softDeletes();
21
-            $table->timestamps();
22
-        });
23
-    }
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('settings', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('name', 100);
18
+			$table->string('key', 100)->unique();
19
+			$table->text('value')->nullable();
20
+			$table->softDeletes();
21
+			$table->timestamps();
22
+		});
23
+	}
24 24
 
25
-    /**
26
-     * Reverse the migrations.
27
-     *
28
-     * @return void
29
-     */
30
-    public function down()
31
-    {
32
-        Schema::dropIfExists('settings');
33
-    }
25
+	/**
26
+	 * Reverse the migrations.
27
+	 *
28
+	 * @return void
29
+	 */
30
+	public function down()
31
+	{
32
+		Schema::dropIfExists('settings');
33
+	}
34 34
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('settings', function (Blueprint $table) {
15
+        Schema::create('settings', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('name', 100);
18 18
             $table->string('key', 100)->unique();
Please login to merge, or discard this patch.
src/Modules/Core/Database/Seeds/CoreDatabaseSeeder.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class CoreDatabaseSeeder 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(SettingsTableSeeder::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(SettingsTableSeeder::class);
18
+		$this->call(AssignRelationsSeeder::class);
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/Core/Database/Seeds/AssignRelationsSeeder.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 
7 7
 class AssignRelationsSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin group.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['settings'])->each(function ($permission) use ($adminGroupId) {
22
-            \DB::table('groups_permissions')->insert(
23
-                [
24
-                'permission_id' => $permission->id,
25
-                'group_id'      => $adminGroupId,
26
-                'created_at'    => \DB::raw('NOW()'),
27
-                'updated_at'    => \DB::raw('NOW()')
28
-                ]
29
-            );
30
-        });
31
-    }
18
+		/**
19
+		 * Assign the permissions to the admin group.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['settings'])->each(function ($permission) use ($adminGroupId) {
22
+			\DB::table('groups_permissions')->insert(
23
+				[
24
+				'permission_id' => $permission->id,
25
+				'group_id'      => $adminGroupId,
26
+				'created_at'    => \DB::raw('NOW()'),
27
+				'updated_at'    => \DB::raw('NOW()')
28
+				]
29
+			);
30
+		});
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin group.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['settings'])->each(function ($permission) use ($adminGroupId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['settings'])->each(function($permission) use ($adminGroupId) {
22 22
             \DB::table('groups_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/Core/Database/Seeds/SettingsTableSeeder.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -6,76 +6,76 @@
 block discarded – undo
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'       => 'save',
26
-                'model'      => 'settings',
27
-                'created_at' => \DB::raw('NOW()'),
28
-                'updated_at' => \DB::raw('NOW()')
29
-                ],
30
-                [
31
-                'name'       => 'find',
32
-                'model'      => 'settings',
33
-                'created_at' => \DB::raw('NOW()'),
34
-                'updated_at' => \DB::raw('NOW()')
35
-                ],
36
-                [
37
-                'name'       => 'search',
38
-                'model'      => 'settings',
39
-                'created_at' => \DB::raw('NOW()'),
40
-                'updated_at' => \DB::raw('NOW()')
41
-                ],
42
-                [
43
-                'name'       => 'list',
44
-                'model'      => 'settings',
45
-                'created_at' => \DB::raw('NOW()'),
46
-                'updated_at' => \DB::raw('NOW()')
47
-                ],
48
-                [
49
-                'name'       => 'findby',
50
-                'model'      => 'settings',
51
-                'created_at' => \DB::raw('NOW()'),
52
-                'updated_at' => \DB::raw('NOW()')
53
-                ],
54
-                [
55
-                'name'       => 'first',
56
-                'model'      => 'settings',
57
-                'created_at' => \DB::raw('NOW()'),
58
-                'updated_at' => \DB::raw('NOW()')
59
-                ],
60
-                [
61
-                'name'       => 'paginate',
62
-                'model'      => 'settings',
63
-                'created_at' => \DB::raw('NOW()'),
64
-                'updated_at' => \DB::raw('NOW()')
65
-                ],
66
-                [
67
-                'name'       => 'paginateby',
68
-                'model'      => 'settings',
69
-                'created_at' => \DB::raw('NOW()'),
70
-                'updated_at' => \DB::raw('NOW()')
71
-                ],
72
-                [
73
-                'name'       => 'saveMany',
74
-                'model'      => 'settings',
75
-                'created_at' => \DB::raw('NOW()'),
76
-                'updated_at' => \DB::raw('NOW()')
77
-                ]
78
-            ]
79
-        );
80
-    }
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'       => 'save',
26
+				'model'      => 'settings',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'find',
32
+				'model'      => 'settings',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'search',
38
+				'model'      => 'settings',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'list',
44
+				'model'      => 'settings',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'findby',
50
+				'model'      => 'settings',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'first',
56
+				'model'      => 'settings',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'paginate',
62
+				'model'      => 'settings',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				],
66
+				[
67
+				'name'       => 'paginateby',
68
+				'model'      => 'settings',
69
+				'created_at' => \DB::raw('NOW()'),
70
+				'updated_at' => \DB::raw('NOW()')
71
+				],
72
+				[
73
+				'name'       => 'saveMany',
74
+				'model'      => 'settings',
75
+				'created_at' => \DB::raw('NOW()'),
76
+				'updated_at' => \DB::raw('NOW()')
77
+				]
78
+			]
79
+		);
80
+	}
81 81
 }
Please login to merge, or discard this patch.
src/Modules/Core/Database/Seeds/ClearDataSeeder.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class ClearDataSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $permissions = \DB::table('permissions')->whereIn('model', ['settings']);
17
-        \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
-        $permissions->delete();
19
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$permissions = \DB::table('permissions')->whereIn('model', ['settings']);
17
+		\DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
+		$permissions->delete();
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/Core/Decorators/CachingDecorator.php 2 patches
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -5,111 +5,111 @@
 block discarded – undo
5 5
 
6 6
 class CachingDecorator
7 7
 {
8
-    /**
9
-     * The repo implementation.
10
-     *
11
-     * @var string
12
-     */
13
-    public $repo;
8
+	/**
9
+	 * The repo implementation.
10
+	 *
11
+	 * @var string
12
+	 */
13
+	public $repo;
14 14
 
15
-    /**
16
-     * The cache implementation.
17
-     *
18
-     * @var object
19
-     */
20
-    protected $cache;
15
+	/**
16
+	 * The cache implementation.
17
+	 *
18
+	 * @var object
19
+	 */
20
+	protected $cache;
21 21
 
22
-    /**
23
-     * The modelKey implementation.
24
-     *
25
-     * @var string
26
-     */
27
-    public $modelKey;
22
+	/**
23
+	 * The modelKey implementation.
24
+	 *
25
+	 * @var string
26
+	 */
27
+	public $modelKey;
28 28
 
29
-    /**
30
-     * The model implementation.
31
-     *
32
-     * @var string
33
-     */
34
-    public $model;
29
+	/**
30
+	 * The model implementation.
31
+	 *
32
+	 * @var string
33
+	 */
34
+	public $model;
35 35
 
36
-    /**
37
-     * The modelClass implementation.
38
-     *
39
-     * @var string
40
-     */
41
-    public $modelClass;
36
+	/**
37
+	 * The modelClass implementation.
38
+	 *
39
+	 * @var string
40
+	 */
41
+	public $modelClass;
42 42
 
43
-    /**
44
-     * The cacheConfig implementation.
45
-     *
46
-     * @var mixed
47
-     */
48
-    public $cacheConfig;
43
+	/**
44
+	 * The cacheConfig implementation.
45
+	 *
46
+	 * @var mixed
47
+	 */
48
+	public $cacheConfig;
49 49
 
50
-    /**
51
-     * The cacheTag implementation.
52
-     *
53
-     * @var string
54
-     */
55
-    public $cacheTag;
50
+	/**
51
+	 * The cacheTag implementation.
52
+	 *
53
+	 * @var string
54
+	 */
55
+	public $cacheTag;
56 56
     
57
-    /**
58
-     * Create new CachingDecorator instance.
59
-     */
60
-    public function __construct($repo, $cache)
61
-    {
62
-        $this->repo       = $repo;
63
-        $this->cache      = $cache;
64
-        $this->model      = $this->repo->model;
65
-        $this->modelClass = get_class($this->model);
66
-        $repoClass        = explode('\\', get_class($this->repo));
67
-        $repoName         = end($repoClass);
68
-        $this->cacheTag   = Str::plural(lcfirst(substr($repoName, 0, strpos($repoName, 'Repository'))));
69
-    }
57
+	/**
58
+	 * Create new CachingDecorator instance.
59
+	 */
60
+	public function __construct($repo, $cache)
61
+	{
62
+		$this->repo       = $repo;
63
+		$this->cache      = $cache;
64
+		$this->model      = $this->repo->model;
65
+		$this->modelClass = get_class($this->model);
66
+		$repoClass        = explode('\\', get_class($this->repo));
67
+		$repoName         = end($repoClass);
68
+		$this->cacheTag   = Str::plural(lcfirst(substr($repoName, 0, strpos($repoName, 'Repository'))));
69
+	}
70 70
 
71
-    /**
72
-     * Handle the cache mechanism for the called method
73
-     * based the configurations.
74
-     *
75
-     * @param  string $name the called method name
76
-     * @param  array  $arguments the method arguments
77
-     * @return object
78
-     */
79
-    public function __call($name, $arguments)
80
-    {
81
-        $this->setCacheConfig($name);
71
+	/**
72
+	 * Handle the cache mechanism for the called method
73
+	 * based the configurations.
74
+	 *
75
+	 * @param  string $name the called method name
76
+	 * @param  array  $arguments the method arguments
77
+	 * @return object
78
+	 */
79
+	public function __call($name, $arguments)
80
+	{
81
+		$this->setCacheConfig($name);
82 82
 
83
-        if ($this->cacheConfig && $this->cacheConfig == 'cache') {
84
-            $page     = \Request::get('page') !== null ? \Request::get('page') : '1';
85
-            $cacheKey = $name.$page.\Session::get('locale').serialize($arguments);
86
-            return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function () use ($arguments, $name) {
87
-                return call_user_func_array([$this->repo, $name], $arguments);
88
-            });
89
-        } elseif ($this->cacheConfig) {
90
-            $this->cache->tags($this->cacheConfig)->flush();
91
-            return call_user_func_array([$this->repo, $name], $arguments);
92
-        }
83
+		if ($this->cacheConfig && $this->cacheConfig == 'cache') {
84
+			$page     = \Request::get('page') !== null ? \Request::get('page') : '1';
85
+			$cacheKey = $name.$page.\Session::get('locale').serialize($arguments);
86
+			return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function () use ($arguments, $name) {
87
+				return call_user_func_array([$this->repo, $name], $arguments);
88
+			});
89
+		} elseif ($this->cacheConfig) {
90
+			$this->cache->tags($this->cacheConfig)->flush();
91
+			return call_user_func_array([$this->repo, $name], $arguments);
92
+		}
93 93
 
94
-        return call_user_func_array([$this->repo, $name], $arguments);
95
-    }
94
+		return call_user_func_array([$this->repo, $name], $arguments);
95
+	}
96 96
 
97
-    /**
98
-     * Set cache config based on the called method.
99
-     *
100
-     * @param  string $name
101
-     * @return void
102
-     */
103
-    private function setCacheConfig($name)
104
-    {
105
-        $config            = \CoreConfig::getConfig();
106
-        $cacheConfig       = Arr::get($config['cacheConfig'], $this->cacheTag, false);
107
-        $this->cacheConfig = false;
97
+	/**
98
+	 * Set cache config based on the called method.
99
+	 *
100
+	 * @param  string $name
101
+	 * @return void
102
+	 */
103
+	private function setCacheConfig($name)
104
+	{
105
+		$config            = \CoreConfig::getConfig();
106
+		$cacheConfig       = Arr::get($config['cacheConfig'], $this->cacheTag, false);
107
+		$this->cacheConfig = false;
108 108
 
109
-        if ($cacheConfig && in_array($name, $cacheConfig['cache'])) {
110
-            $this->cacheConfig = 'cache';
111
-        } elseif ($cacheConfig && isset($cacheConfig['clear'][$name])) {
112
-            $this->cacheConfig = $cacheConfig['clear'][$name];
113
-        }
114
-    }
109
+		if ($cacheConfig && in_array($name, $cacheConfig['cache'])) {
110
+			$this->cacheConfig = 'cache';
111
+		} elseif ($cacheConfig && isset($cacheConfig['clear'][$name])) {
112
+			$this->cacheConfig = $cacheConfig['clear'][$name];
113
+		}
114
+	}
115 115
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
         if ($this->cacheConfig && $this->cacheConfig == 'cache') {
84 84
             $page     = \Request::get('page') !== null ? \Request::get('page') : '1';
85 85
             $cacheKey = $name.$page.\Session::get('locale').serialize($arguments);
86
-            return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function () use ($arguments, $name) {
86
+            return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) {
87 87
                 return call_user_func_array([$this->repo, $name], $arguments);
88 88
             });
89 89
         } elseif ($this->cacheConfig) {
Please login to merge, or discard this patch.
src/Modules/Core/Interfaces/RepositoryInterface.php 1 patch
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -2,118 +2,118 @@
 block discarded – undo
2 2
 
3 3
 interface RepositoryInterface
4 4
 {
5
-    /**
6
-     * Fetch all records with relations from the storage.
7
-     *
8
-     * @param  array  $relations
9
-     * @param  array  $sortBy
10
-     * @param  array  $desc
11
-     * @param  array  $columns
12
-     * @return collection
13
-     */
14
-    public function all($relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
5
+	/**
6
+	 * Fetch all records with relations from the storage.
7
+	 *
8
+	 * @param  array  $relations
9
+	 * @param  array  $sortBy
10
+	 * @param  array  $desc
11
+	 * @param  array  $columns
12
+	 * @return collection
13
+	 */
14
+	public function all($relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
15 15
     
16
-    /**
17
-     * Fetch all records with relations from storage in pages
18
-     * that matche the given query.
19
-     *
20
-     * @param  string  $query
21
-     * @param  integer $perPage
22
-     * @param  array   $relations
23
-     * @param  array   $sortBy
24
-     * @param  array   $desc
25
-     * @param  array   $columns
26
-     * @return collection
27
-     */
28
-    public function search($query, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
16
+	/**
17
+	 * Fetch all records with relations from storage in pages
18
+	 * that matche the given query.
19
+	 *
20
+	 * @param  string  $query
21
+	 * @param  integer $perPage
22
+	 * @param  array   $relations
23
+	 * @param  array   $sortBy
24
+	 * @param  array   $desc
25
+	 * @param  array   $columns
26
+	 * @return collection
27
+	 */
28
+	public function search($query, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
29 29
 
30
-    /**
31
-     * Fetch all records with relations from storage in pages.
32
-     *
33
-     * @param  integer $perPage
34
-     * @param  array   $relations
35
-     * @param  array   $sortBy
36
-     * @param  array   $desc
37
-     * @param  array   $columns
38
-     * @return collection
39
-     */
40
-    public function paginate($perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
30
+	/**
31
+	 * Fetch all records with relations from storage in pages.
32
+	 *
33
+	 * @param  integer $perPage
34
+	 * @param  array   $relations
35
+	 * @param  array   $sortBy
36
+	 * @param  array   $desc
37
+	 * @param  array   $columns
38
+	 * @return collection
39
+	 */
40
+	public function paginate($perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
41 41
     
42
-    /**
43
-     * Fetch all records with relations based on
44
-     * the given condition from storage in pages.
45
-     *
46
-     * @param  array   $conditions array of conditions
47
-     * @param  integer $perPage
48
-     * @param  array   $relations
49
-     * @param  array   $sortBy
50
-     * @param  array   $desc
51
-     * @param  array   $columns
52
-     * @return collection
53
-     */
54
-    public function paginateBy($conditions, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
42
+	/**
43
+	 * Fetch all records with relations based on
44
+	 * the given condition from storage in pages.
45
+	 *
46
+	 * @param  array   $conditions array of conditions
47
+	 * @param  integer $perPage
48
+	 * @param  array   $relations
49
+	 * @param  array   $sortBy
50
+	 * @param  array   $desc
51
+	 * @param  array   $columns
52
+	 * @return collection
53
+	 */
54
+	public function paginateBy($conditions, $perPage = 15, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
55 55
 
56
-     /**
57
-      * Save the given model/models to the storage.
58
-      *
59
-      * @param  array $data
60
-      * @return mixed
61
-      */
62
-    public function save(array $data);
56
+	 /**
57
+	  * Save the given model/models to the storage.
58
+	  *
59
+	  * @param  array $data
60
+	  * @return mixed
61
+	  */
62
+	public function save(array $data);
63 63
 
64
-    /**
65
-     * Update record in the storage based on the given
66
-     * condition.
67
-     *
68
-     * @param  var     $value condition value
69
-     * @param  array   $data
70
-     * @param  string  $attribute condition column name
71
-     * @return integer affected rows
72
-     */
73
-    public function update($value, array $data, $attribute = 'id');
64
+	/**
65
+	 * Update record in the storage based on the given
66
+	 * condition.
67
+	 *
68
+	 * @param  var     $value condition value
69
+	 * @param  array   $data
70
+	 * @param  string  $attribute condition column name
71
+	 * @return integer affected rows
72
+	 */
73
+	public function update($value, array $data, $attribute = 'id');
74 74
 
75
-    /**
76
-     * Delete record from the storage based on the given
77
-     * condition.
78
-     *
79
-     * @param  var     $value condition value
80
-     * @param  string  $attribute condition column name
81
-     * @return integer affected rows
82
-     */
83
-    public function delete($value, $attribute = 'id');
75
+	/**
76
+	 * Delete record from the storage based on the given
77
+	 * condition.
78
+	 *
79
+	 * @param  var     $value condition value
80
+	 * @param  string  $attribute condition column name
81
+	 * @return integer affected rows
82
+	 */
83
+	public function delete($value, $attribute = 'id');
84 84
     
85
-    /**
86
-     * Fetch records from the storage based on the given
87
-     * id.
88
-     *
89
-     * @param  integer $id
90
-     * @param  array   $relations
91
-     * @param  array   $columns
92
-     * @return object
93
-     */
94
-    public function find($id, $relations = [], $columns = array('*'));
85
+	/**
86
+	 * Fetch records from the storage based on the given
87
+	 * id.
88
+	 *
89
+	 * @param  integer $id
90
+	 * @param  array   $relations
91
+	 * @param  array   $columns
92
+	 * @return object
93
+	 */
94
+	public function find($id, $relations = [], $columns = array('*'));
95 95
     
96
-    /**
97
-     * Fetch records from the storage based on the given
98
-     * condition.
99
-     *
100
-     * @param  array   $conditions array of conditions
101
-     * @param  array   $relations
102
-     * @param  array   $sortBy
103
-     * @param  array   $desc
104
-     * @param  array   $columns
105
-     * @return collection
106
-     */
107
-    public function findBy($conditions, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
96
+	/**
97
+	 * Fetch records from the storage based on the given
98
+	 * condition.
99
+	 *
100
+	 * @param  array   $conditions array of conditions
101
+	 * @param  array   $relations
102
+	 * @param  array   $sortBy
103
+	 * @param  array   $desc
104
+	 * @param  array   $columns
105
+	 * @return collection
106
+	 */
107
+	public function findBy($conditions, $relations = [], $sortBy = 'created_at', $desc = 0, $columns = array('*'));
108 108
 
109
-    /**
110
-     * Fetch the first record fro the storage based on the given
111
-     * condition.
112
-     *
113
-     * @param  array   $conditions array of conditions
114
-     * @param  array   $relations
115
-     * @param  array   $columns
116
-     * @return object
117
-     */
118
-    public function first($conditions, $relations = [], $columns = array('*'));
109
+	/**
110
+	 * Fetch the first record fro the storage based on the given
111
+	 * condition.
112
+	 *
113
+	 * @param  array   $conditions array of conditions
114
+	 * @param  array   $relations
115
+	 * @param  array   $columns
116
+	 * @return object
117
+	 */
118
+	public function first($conditions, $relations = [], $columns = array('*'));
119 119
 }
Please login to merge, or discard this patch.
src/Modules/Core/Interfaces/RepositoryContainerInterface.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 
3 3
 interface RepositoryContainerInterface
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
 }
Please login to merge, or discard this patch.
src/Modules/Core/Http/Controllers/SettingsController.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,31 +7,31 @@
 block discarded – undo
7 7
 
8 8
 class SettingsController extends BaseApiController
9 9
 {
10
-    /**
11
-     * The name of the model that is used by the base api controller
12
-     * to preform actions like (add, edit ... etc).
13
-     * @var string
14
-     */
15
-    protected $model = 'settings';
10
+	/**
11
+	 * The name of the model that is used by the base api controller
12
+	 * to preform actions like (add, edit ... etc).
13
+	 * @var string
14
+	 */
15
+	protected $model = 'settings';
16 16
 
17
-    /**
18
-     * The validations rules used by the base api controller
19
-     * to check before add.
20
-     * @var array
21
-     */
22
-    protected $validationRules = [
23
-        'id'    => 'required|exists:settings,id',
24
-        'value' => 'required|string'
25
-    ];
17
+	/**
18
+	 * The validations rules used by the base api controller
19
+	 * to check before add.
20
+	 * @var array
21
+	 */
22
+	protected $validationRules = [
23
+		'id'    => 'required|exists:settings,id',
24
+		'value' => 'required|string'
25
+	];
26 26
     
27
-    /**
28
-     * Save list of settings.
29
-     *
30
-     * @param  \Illuminate\Http\Request  $request
31
-     * @return \Illuminate\Http\Response
32
-     */
33
-    public function saveMany(Request $request)
34
-    {
35
-        return \Response::json($this->repo->saveMany($request->all()), 200);
36
-    }
27
+	/**
28
+	 * Save list of settings.
29
+	 *
30
+	 * @param  \Illuminate\Http\Request  $request
31
+	 * @return \Illuminate\Http\Response
32
+	 */
33
+	public function saveMany(Request $request)
34
+	{
35
+		return \Response::json($this->repo->saveMany($request->all()), 200);
36
+	}
37 37
 }
Please login to merge, or discard this patch.