@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function generateForm($entity, $method = 'post') |
74 | 74 | { |
75 | 75 | $html = '<form method="post" action="#"> |
76 | - <input type="hidden" name="__method" value="'.$method.'">'; |
|
76 | + <input type="hidden" name="__method" value="'.$method . '">'; |
|
77 | 77 | $html .= $this->getInputs($entity); |
78 | 78 | $html .= '</form>'; |
79 | 79 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getFillables($entity) |
89 | 89 | { |
90 | - if (! empty($entity->getFillable())) { |
|
90 | + if (!empty($entity->getFillable())) { |
|
91 | 91 | return $entity->getFillable(); |
92 | 92 | } |
93 | 93 |
@@ -72,6 +72,6 @@ |
||
72 | 72 | |
73 | 73 | public function getFormStub($type) |
74 | 74 | { |
75 | - return file_get_contents(Config::get('repository.stubs_path').'/fields-'.$type.'.stub'); |
|
75 | + return file_get_contents(Config::get('repository.stubs_path') . '/fields-' . $type . '.stub'); |
|
76 | 76 | } |
77 | 77 | } |
@@ -6,11 +6,11 @@ |
||
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 | 11 | 'resources_path' => realpath('resources'), |
12 | - 'stubs_path' => realpath('resources').'/stubs/', |
|
13 | - 'lang_path' => realpath('resources').'/lang/', |
|
12 | + 'stubs_path' => realpath('resources') . '/stubs/', |
|
13 | + 'lang_path' => realpath('resources') . '/lang/', |
|
14 | 14 | 'config_path' => realpath('config'), |
15 | 15 | |
16 | 16 | //relative to app path |
@@ -92,7 +92,7 @@ |
||
92 | 92 | * |
93 | 93 | * @return LengthAwarePaginator |
94 | 94 | */ |
95 | - public function get($criteria = [],$columns = []); |
|
95 | + public function get($criteria = [], $columns = []); |
|
96 | 96 | |
97 | 97 | /** |
98 | 98 | * @param string $name |
@@ -115,11 +115,11 @@ |
||
115 | 115 | if (isset($criteria['search'])) { |
116 | 116 | foreach ($this->model->searchable as $method => $columns) { |
117 | 117 | if (method_exists($this->model, $method)) { |
118 | - $latest->orWhereHas($method, function ($query) use ($criteria, $columns) { |
|
118 | + $latest->orWhereHas($method, function($query) use ($criteria, $columns) { |
|
119 | 119 | /* @var $query Builder */ |
120 | - $query->where(function ($query2) use ($criteria, $columns) { |
|
120 | + $query->where(function($query2) use ($criteria, $columns) { |
|
121 | 121 | /* @var $query2 Builder */ |
122 | - foreach ((array)$columns as $column) { |
|
122 | + foreach ((array) $columns as $column) { |
|
123 | 123 | $query2->orWhere($column, 'like', '%' . $criteria['search'] . '%'); |
124 | 124 | } |
125 | 125 | }); |
@@ -63,10 +63,10 @@ |
||
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 |
@@ -25,25 +25,25 @@ |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | $this->publishes([ |
28 | - __DIR__.'/config' => realpath('config'), |
|
28 | + __DIR__ . '/config' => realpath('config'), |
|
29 | 29 | ], 'repository-generator'); |
30 | 30 | |
31 | 31 | if (null === $this->app['config']->get('repository')) { |
32 | - $this->app['config']->set('repository', require __DIR__.'/config/repository.php'); |
|
32 | + $this->app['config']->set('repository', require __DIR__ . '/config/repository.php'); |
|
33 | 33 | } |
34 | - $this->mergeConfigFrom(__DIR__.'/config/repository.php', 'repository-config'); |
|
34 | + $this->mergeConfigFrom(__DIR__ . '/config/repository.php', 'repository-config'); |
|
35 | 35 | $resourcesPathStub = resource_path('/stubs'); |
36 | - $stubPath = realpath(__DIR__.'/../stubs'); |
|
37 | - $langPath = Config::get('repository.lang_path').'/en'; |
|
36 | + $stubPath = realpath(__DIR__ . '/../stubs'); |
|
37 | + $langPath = Config::get('repository.lang_path') . '/en'; |
|
38 | 38 | |
39 | - if(!is_dir($resourcesPathStub)) |
|
39 | + if (!is_dir($resourcesPathStub)) |
|
40 | 40 | { |
41 | - mkdir($resourcesPathStub,0777,true); |
|
41 | + mkdir($resourcesPathStub, 0777, true); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->publishes([ |
45 | 45 | $stubPath => Config::get('repository.stubs_path', $resourcesPathStub), |
46 | - __DIR__.'/lang' => $langPath, |
|
46 | + __DIR__ . '/lang' => $langPath, |
|
47 | 47 | ], 'repository-stub'); |
48 | 48 | } |
49 | 49 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | */ |
52 | 52 | public function handle() |
53 | 53 | { |
54 | - $file = preg_split(' (/|\\\\) ', (string)$this->argument('name')) ?? []; |
|
54 | + $file = preg_split(' (/|\\\\) ', (string) $this->argument('name')) ?? []; |
|
55 | 55 | |
56 | 56 | if (!$file) { |
57 | 57 | return 'Something wrong with the inputs !'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function handle() |
63 | 63 | { |
64 | - $file = preg_split(' ([/\\\]) ', (string)$this->argument('name')) ?? []; |
|
64 | + $file = preg_split(' ([/\\\]) ', (string) $this->argument('name')) ?? []; |
|
65 | 65 | |
66 | 66 | if (!$file) { |
67 | 67 | return 'Something wrong with the inputs !'; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $request = Config::get('repository.requests_folder', 'Http\Requests'); |
91 | 91 | $resource = Config::get('repository.resources_folder', 'Http\Resources'); |
92 | 92 | |
93 | - $base="Shamaseen\Repository\Generator\Utility"; |
|
93 | + $base = "Shamaseen\Repository\Generator\Utility"; |
|
94 | 94 | $modelBase = Config::get('repository.base_model', "{$base}\Entity"); |
95 | 95 | $interfaceBase = Config::get('repository.base_interface', "{$base}\ContractInterface"); |
96 | 96 | $repositoryBase = Config::get('repository.base_repository', "{$base}\AbstractRepository"); |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | $languagePath = Config::get('repository.lang_path'); |
153 | 153 | |
154 | 154 | foreach (Config::get('repository.languages') as $lang) { |
155 | - $this->generate($repositoryName, $languagePath, $lang,'lang'); |
|
155 | + $this->generate($repositoryName, $languagePath, $lang, 'lang'); |
|
156 | 156 | } |
157 | 157 | |
158 | - $this->generate($repositoryName, $viewsPath, $repositoryName, 'create',$createHtml); |
|
158 | + $this->generate($repositoryName, $viewsPath, $repositoryName, 'create', $createHtml); |
|
159 | 159 | $this->generate($repositoryName, $viewsPath, $repositoryName, 'edit', $editHtml); |
160 | - $this->generate($repositoryName, $viewsPath, $repositoryName,'index'); |
|
161 | - $this->generate($repositoryName, $viewsPath, $repositoryName,'show'); |
|
160 | + $this->generate($repositoryName, $viewsPath, $repositoryName, 'index'); |
|
161 | + $this->generate($repositoryName, $viewsPath, $repositoryName, 'show'); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |