@@ -344,9 +344,10 @@ |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | if ($entity) { |
347 | - if($appendEntity) |
|
348 | - return response()->json( ['status' => true, 'message' => __('messages.success'), 'data' => $entity], |
|
347 | + if($appendEntity) { |
|
348 | + return response()->json( ['status' => true, 'message' => __('messages.success'), 'data' => $entity], |
|
349 | 349 | JsonResponse::HTTP_OK); |
350 | + } |
|
350 | 351 | return response()->json(null, JsonResponse::HTTP_NO_CONTENT); |
351 | 352 | } |
352 | 353 |
@@ -100,9 +100,9 @@ |
||
100 | 100 | } |
101 | 101 | }); |
102 | 102 | }); |
103 | + } else { |
|
104 | + $latest->orWhere($columns, 'like', "%" . $criteria['search'] . "%", 'or'); |
|
103 | 105 | } |
104 | - else |
|
105 | - $latest->orWhere($columns, 'like', "%" . $criteria['search'] . "%", 'or'); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | unset($criteria['search']); |
@@ -86,8 +86,9 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function getFillables($entity) |
88 | 88 | { |
89 | - if(!empty($entity->getFillable())) |
|
90 | - return $entity->getFillable(); |
|
89 | + if(!empty($entity->getFillable())) { |
|
90 | + return $entity->getFillable(); |
|
91 | + } |
|
91 | 92 | |
92 | 93 | $columns = \Schema::getColumnListing($entity->getTable()); |
93 | 94 | |
@@ -107,8 +108,9 @@ discard block |
||
107 | 108 | */ |
108 | 109 | function getInputs($entity) |
109 | 110 | { |
110 | - if($this->inputs) |
|
111 | - return $this->inputs; |
|
111 | + if($this->inputs) { |
|
112 | + return $this->inputs; |
|
113 | + } |
|
112 | 114 | |
113 | 115 | return $this->generateInputs($entity); |
114 | 116 | } |
@@ -104,8 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $createHtml = $this->formGenerator->generateForm($entity); |
106 | 106 | $editHtml = $this->formGenerator->generateForm($entity,'put'); |
107 | - } |
|
108 | - else |
|
107 | + } else |
|
109 | 108 | { |
110 | 109 | if(!$this->confirm('There is no entity for '.$this->repoName.", do you want to continue (this will disable form generator) ?")) |
111 | 110 | { |
@@ -132,8 +131,9 @@ discard block |
||
132 | 131 | function getEntity($path) |
133 | 132 | { |
134 | 133 | $myClass = 'App\Entities\\'.$path."\\".$this->repoName; |
135 | - if(!class_exists($myClass)) |
|
136 | - return false; |
|
134 | + if(!class_exists($myClass)) { |
|
135 | + return false; |
|
136 | + } |
|
137 | 137 | |
138 | 138 | $refl = new ReflectionClass($myClass); |
139 | 139 |