@@ -29,14 +29,14 @@ |
||
29 | 29 | protected function failedValidation(Validator $validator) |
30 | 30 | { |
31 | 31 | |
32 | - if (strpos($this->path(),'api') !== false) { |
|
32 | + if (strpos($this->path(), 'api') !== false) { |
|
33 | 33 | $errors = (new ValidationException($validator))->errors(); |
34 | 34 | throw new HttpResponseException(response()->json(['success' => false, 'errors' => $errors, |
35 | 35 | ], JsonResponse::HTTP_UNPROCESSABLE_ENTITY)); |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | - public function rules(){ |
|
40 | - \App::setLocale($this->header('Language','en')); |
|
39 | + public function rules() { |
|
40 | + \App::setLocale($this->header('Language', 'en')); |
|
41 | 41 | } |
42 | 42 | } |
@@ -51,7 +51,6 @@ |
||
51 | 51 | /** |
52 | 52 | * Execute the console command. |
53 | 53 | * |
54 | - |
|
55 | 54 | */ |
56 | 55 | public function handle() |
57 | 56 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function handle() |
57 | 57 | { |
58 | 58 | |
59 | - $file = explode("/", (string)$this->argument('name')); |
|
59 | + $file = explode("/", (string) $this->argument('name')); |
|
60 | 60 | |
61 | 61 | $this->repoName = $file[count($file) - 1]; |
62 | 62 | unset($file[count($file) - 1]); |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | $this->repoNamespace = $file[count($file) - 1]; |
69 | 69 | $this->repoNamespace = implode("\\", $file); |
70 | 70 | } |
71 | - $model= str_plural(\Config::get('repository.model')); |
|
72 | - $interface= str_plural(\Config::get('repository.interface')); |
|
73 | - $repository= str_plural(\Config::get('repository.repository')); |
|
71 | + $model = str_plural(\Config::get('repository.model')); |
|
72 | + $interface = str_plural(\Config::get('repository.interface')); |
|
73 | + $repository = str_plural(\Config::get('repository.repository')); |
|
74 | 74 | |
75 | 75 | $this->generate($path, \Config::get('repository.controllers_path'), 'Controller'); |
76 | 76 | $this->generate($path, $model, 'Entity'); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | protected $breadcrumbs; |
37 | 37 | |
38 | 38 | protected $menu; |
39 | - protected $search ; |
|
39 | + protected $search; |
|
40 | 40 | protected $selectedMenu = []; |
41 | 41 | protected $isAPI = false; |
42 | 42 | protected $trash = false; |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | } |
64 | 64 | $limit = $request->get('limit', 10); |
65 | 65 | |
66 | - if ((bool)$request->get('with-trash', false)) { |
|
66 | + if ((bool) $request->get('with-trash', false)) { |
|
67 | 67 | $interface->withTrash(); |
68 | 68 | } |
69 | - if ((bool)$request->get('only-trash', false)) { |
|
69 | + if ((bool) $request->get('only-trash', false)) { |
|
70 | 70 | $interface->trash(); |
71 | 71 | } |
72 | 72 |
@@ -35,10 +35,10 @@ |
||
35 | 35 | parent::__construct($app); |
36 | 36 | |
37 | 37 | |
38 | - $interfaces= str_plural(Config::get('repository.interface')); |
|
39 | - $repositories= str_plural(Config::get('repository.repository')); |
|
40 | - $interface= Config::get('repository.interface'); |
|
41 | - $repository= Config::get('repository.repository'); |
|
38 | + $interfaces = str_plural(Config::get('repository.interface')); |
|
39 | + $repositories = str_plural(Config::get('repository.repository')); |
|
40 | + $interface = Config::get('repository.interface'); |
|
41 | + $repository = Config::get('repository.repository'); |
|
42 | 42 | |
43 | 43 | $contractsFolder = realpath(__DIR__ . '/../../../../app/' . $interfaces); |
44 | 44 | if ($contractsFolder) { |
@@ -6,9 +6,9 @@ |
||
6 | 6 | * Time: 09:58 am |
7 | 7 | */ |
8 | 8 | return [ |
9 | - 'app_path' => realpath(__DIR__.'/../app/'), |
|
9 | + 'app_path' => realpath(__DIR__ . '/../app/'), |
|
10 | 10 | 'route_path' => realpath('routes/'), |
11 | - 'resources_path' => realpath(__DIR__.'/../vendor/shamaseen/repository-generator/stubs'), |
|
11 | + 'resources_path' => realpath(__DIR__ . '/../vendor/shamaseen/repository-generator/stubs'), |
|
12 | 12 | |
13 | 13 | //relative to app path |
14 | 14 | 'interface' => 'Interface', |
@@ -26,17 +26,17 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | $this->publishes([ |
29 | - __DIR__.'/config' => realpath('config'), |
|
30 | - ],'repository-config'); |
|
29 | + __DIR__ . '/config' => realpath('config'), |
|
30 | + ], 'repository-config'); |
|
31 | 31 | |
32 | 32 | if ($this->app['config']->get('repository') === null) { |
33 | - $this->app['config']->set('repository', require __DIR__.'/config/repository.php'); |
|
33 | + $this->app['config']->set('repository', require __DIR__ . '/config/repository.php'); |
|
34 | 34 | } |
35 | - $this->mergeConfigFrom(__DIR__.'/config/repository.php', 'repository-config'); |
|
35 | + $this->mergeConfigFrom(__DIR__ . '/config/repository.php', 'repository-config'); |
|
36 | 36 | |
37 | 37 | $this->publishes([ |
38 | - __DIR__ . '/stubs' => \Config::get('repository.resources_path',realpath(__DIR__.'/../../../../resources/'))."/stubs/", |
|
39 | - ],'repository-stub'); |
|
38 | + __DIR__ . '/stubs' => \Config::get('repository.resources_path', realpath(__DIR__ . '/../../../../resources/')) . "/stubs/", |
|
39 | + ], 'repository-stub'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -76,7 +76,7 @@ |
||
76 | 76 | * @param int $limit |
77 | 77 | * @param array $filters |
78 | 78 | * |
79 | - * @return Paginator |
|
79 | + * @return \Illuminate\Contracts\Pagination\Paginator |
|
80 | 80 | */ |
81 | 81 | public function simplePaginate($limit = 10, $filters = []); |
82 | 82 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function filter($filters = []) |
78 | 78 | { |
79 | - $filters= $this->order($filters); |
|
79 | + $filters = $this->order($filters); |
|
80 | 80 | |
81 | 81 | /** @var Entity $latest */ |
82 | 82 | $latest = $this->model->with($this->with); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @return array |
111 | 111 | */ |
112 | - private function order($filters=[]){ |
|
112 | + private function order($filters = []) { |
|
113 | 113 | |
114 | 114 | if (isset($filters['order'])) { |
115 | 115 | $this->order = $filters['order']; |