@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * to preform actions like (add, edit ... etc). |
| 13 | 13 | * @var string |
| 14 | 14 | */ |
| 15 | - protected $model = 'reports'; |
|
| 15 | + protected $model = 'reports'; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * List of all route actions that the base api controller |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Reporting\Report::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Reporting\Report::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'report_name' => $faker->randomElement(['Users Count', 'Low Stock Products', 'Active Users']), |
| 6 | 6 | 'view_name' => $faker->word(), |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Assign the permissions to the admin group. |
| 20 | 20 | */ |
| 21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function ($permission) use ($adminGroupId) { |
|
| 21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function($permission) use ($adminGroupId) { |
|
| 22 | 22 | \DB::table('groups_permissions')->insert( |
| 23 | 23 | [ |
| 24 | 24 | 'permission_id' => $permission->id, |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function run() |
| 15 | 15 | { |
| 16 | - $permissions = \DB::table('permissions')->whereIn('model', ['reports']); |
|
| 16 | + $permissions = \DB::table('permissions')->whereIn('model', ['reports']); |
|
| 17 | 17 | \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
| 18 | 18 | $permissions->delete(); |
| 19 | 19 | } |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('reports', function (Blueprint $table) { |
|
| 15 | + Schema::create('reports', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | - $table->string('report_name',100); |
|
| 18 | - $table->string('view_name',100); |
|
| 17 | + $table->string('report_name', 100); |
|
| 18 | + $table->string('view_name', 100); |
|
| 19 | 19 | $table->softDeletes(); |
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | }); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | if ($route) |
| 44 | 44 | { |
| 45 | 45 | $actoinArray = explode('@', $route['action']); |
| 46 | - if(array_get($actoinArray, 1, false)) |
|
| 46 | + if (array_get($actoinArray, 1, false)) |
|
| 47 | 47 | { |
| 48 | 48 | $controller = $actoinArray[0]; |
| 49 | 49 | $method = $actoinArray[1]; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $route['response'] = $this->getResponseObject($classProperties['model'], $route['name'], $route['returnDocBlock']); |
| 63 | 63 | |
| 64 | 64 | preg_match('/api\/([^#]+)\//iU', $route['uri'], $module); |
| 65 | - $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/' . $module[1] . '/') - 1)][] = $route; |
|
| 65 | + $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/'.$module[1].'/') - 1)][] = $route; |
|
| 66 | 66 | |
| 67 | 67 | $this->getModels($classProperties['model'], $docData); |
| 68 | 68 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | protected function getRoutes() |
| 83 | 83 | { |
| 84 | - return collect(\Route::getRoutes())->map(function ($route) { |
|
| 84 | + return collect(\Route::getRoutes())->map(function($route) { |
|
| 85 | 85 | if (strpos($route->uri(), 'api') !== false) |
| 86 | 86 | { |
| 87 | 87 | return [ |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | ]; |
| 114 | 114 | |
| 115 | 115 | |
| 116 | - if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) |
|
| 116 | + if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) |
|
| 117 | 117 | { |
| 118 | 118 | $route['headers']['Authorization'] = 'Bearer {token}'; |
| 119 | 119 | } |
@@ -167,16 +167,16 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | else |
| 169 | 169 | { |
| 170 | - $route['body'] = eval('return ' . str_replace(',\'.$request->get(\'id\')', ',{id}\'', $match[1]) . ';'); |
|
| 170 | + $route['body'] = eval('return '.str_replace(',\'.$request->get(\'id\')', ',{id}\'', $match[1]).';'); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | foreach ($route['body'] as &$rule) |
| 174 | 174 | { |
| 175 | - if(strpos($rule, 'unique')) |
|
| 175 | + if (strpos($rule, 'unique')) |
|
| 176 | 176 | { |
| 177 | 177 | $rule = substr($rule, 0, strpos($rule, 'unique') + 6); |
| 178 | 178 | } |
| 179 | - elseif(strpos($rule, 'exists')) |
|
| 179 | + elseif (strpos($rule, 'exists')) |
|
| 180 | 180 | { |
| 181 | 181 | $rule = substr($rule, 0, strpos($rule, 'exists') - 1); |
| 182 | 182 | } |
@@ -249,10 +249,10 @@ discard block |
||
| 249 | 249 | $model = factory($modelClass)->make(); |
| 250 | 250 | $modelArr = $model->toArray(); |
| 251 | 251 | |
| 252 | - if ( $model->trans && ! $model->trans->count()) |
|
| 252 | + if ($model->trans && ! $model->trans->count()) |
|
| 253 | 253 | { |
| 254 | 254 | $modelArr['trans'] = [ |
| 255 | - 'en' => factory($modelClass . 'Translation')->make()->toArray() |
|
| 255 | + 'en' => factory($modelClass.'Translation')->make()->toArray() |
|
| 256 | 256 | ]; |
| 257 | 257 | } |
| 258 | 258 | |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | if ($this->cacheConfig && $this->cacheConfig == 'cache') |
| 81 | 81 | { |
| 82 | 82 | $page = \Request::get('page') !== null ? \Request::get('page') : '1'; |
| 83 | - $cacheKey = $name . $page . \Session::get('locale') . serialize($arguments); |
|
| 83 | + $cacheKey = $name.$page.\Session::get('locale').serialize($arguments); |
|
| 84 | 84 | return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
| 85 | 85 | return call_user_func_array([$this->repo, $name], $arguments); |
| 86 | 86 | }); |
@@ -3,14 +3,14 @@ |
||
| 3 | 3 | use Illuminate\Database\Eloquent\Model; |
| 4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
| 5 | 5 | |
| 6 | -class Settings extends Model{ |
|
| 6 | +class Settings extends Model { |
|
| 7 | 7 | |
| 8 | 8 | use SoftDeletes; |
| 9 | 9 | protected $table = 'settings'; |
| 10 | 10 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
| 11 | 11 | protected $hidden = ['deleted_at']; |
| 12 | 12 | protected $guarded = ['id', 'key']; |
| 13 | - protected $fillable = ['name','value']; |
|
| 13 | + protected $fillable = ['name', 'value']; |
|
| 14 | 14 | public $searchable = ['name', 'value', 'key']; |
| 15 | 15 | |
| 16 | 16 | public function getCreatedAtAttribute($value) |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | Route::group([ |
| 55 | 55 | 'middleware' => 'web', |
| 56 | 56 | 'namespace' => $this->namespace, |
| 57 | - ], function ($router) { |
|
| 57 | + ], function($router) { |
|
| 58 | 58 | require module_path('core', 'Routes/web.php'); |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | 'middleware' => 'api', |
| 73 | 73 | 'namespace' => $this->namespace, |
| 74 | 74 | 'prefix' => 'api', |
| 75 | - ], function ($router) { |
|
| 75 | + ], function($router) { |
|
| 76 | 76 | require module_path('core', 'Routes/api.php'); |
| 77 | 77 | }); |
| 78 | 78 | } |