@@ -16,34 +16,34 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $query = SourceRepo::query(); |
| 18 | 18 | |
| 19 | - if($request->has('searchTerm')) { |
|
| 19 | + if ($request->has('searchTerm')) { |
|
| 20 | 20 | $columnsToSearch = ['group', 'repo_id', 'caln']; |
| 21 | 21 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 22 | - if(!empty($search_term)) { |
|
| 22 | + if (!empty($search_term)) { |
|
| 23 | 23 | $searchQuery = '%' . $search_term . '%'; |
| 24 | - foreach($columnsToSearch as $column) { |
|
| 24 | + foreach ($columnsToSearch as $column) { |
|
| 25 | 25 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($request->has('columnFilters')) { |
|
| 30 | + if ($request->has('columnFilters')) { |
|
| 31 | 31 | |
| 32 | 32 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 33 | 33 | |
| 34 | - foreach($filters as $key => $value) { |
|
| 35 | - if(!empty($value)) { |
|
| 34 | + foreach ($filters as $key => $value) { |
|
| 35 | + if (!empty($value)) { |
|
| 36 | 36 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if($request->has('sort.0')) { |
|
| 41 | + if ($request->has('sort.0')) { |
|
| 42 | 42 | $sort = json_decode($request->sort[0]); |
| 43 | 43 | $query->orderBy($sort->field, $sort->type); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if($request->has("perPage")) { |
|
| 46 | + if ($request->has("perPage")) { |
|
| 47 | 47 | $rows = $query->paginate($request->perPage); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | public function destroy($id) |
| 137 | 137 | { |
| 138 | 138 | $sourcerepo = SourceRepo::find($id); |
| 139 | - if($sourcerepo) { |
|
| 139 | + if ($sourcerepo) { |
|
| 140 | 140 | $sourcerepo->delete(); |
| 141 | 141 | return "true"; |
| 142 | 142 | } |
@@ -16,34 +16,34 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $query = PersonEvent::query(); |
| 18 | 18 | |
| 19 | - if($request->has('searchTerm')) { |
|
| 20 | - $columnsToSearch = ['converted_date', 'year', 'month','day','type','attr','plac','addr_id','phon','caus','age','agnc','adop','adop_famc','person_id','title','date','description','places_id']; |
|
| 19 | + if ($request->has('searchTerm')) { |
|
| 20 | + $columnsToSearch = ['converted_date', 'year', 'month', 'day', 'type', 'attr', 'plac', 'addr_id', 'phon', 'caus', 'age', 'agnc', 'adop', 'adop_famc', 'person_id', 'title', 'date', 'description', 'places_id']; |
|
| 21 | 21 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 22 | - if(!empty($search_term)) { |
|
| 22 | + if (!empty($search_term)) { |
|
| 23 | 23 | $searchQuery = '%' . $search_term . '%'; |
| 24 | - foreach($columnsToSearch as $column) { |
|
| 24 | + foreach ($columnsToSearch as $column) { |
|
| 25 | 25 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($request->has('columnFilters')) { |
|
| 30 | + if ($request->has('columnFilters')) { |
|
| 31 | 31 | |
| 32 | 32 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 33 | 33 | |
| 34 | - foreach($filters as $key => $value) { |
|
| 35 | - if(!empty($value)) { |
|
| 34 | + foreach ($filters as $key => $value) { |
|
| 35 | + if (!empty($value)) { |
|
| 36 | 36 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if($request->has('sort.0')) { |
|
| 41 | + if ($request->has('sort.0')) { |
|
| 42 | 42 | $sort = json_decode($request->sort[0]); |
| 43 | 43 | $query->orderBy($sort->field, $sort->type); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if($request->has("perPage")) { |
|
| 46 | + if ($request->has("perPage")) { |
|
| 47 | 47 | $rows = $query->paginate($request->perPage); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | public function destroy($id) |
| 200 | 200 | { |
| 201 | 201 | $personevent = PersonEvent::find($id); |
| 202 | - if($personevent) { |
|
| 202 | + if ($personevent) { |
|
| 203 | 203 | $personevent->delete(); |
| 204 | 204 | return "true"; |
| 205 | 205 | } |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function getPlans() { |
| 20 | - foreach($this->plans as $plan) { |
|
| 21 | - switch($plan->nickname) { |
|
| 20 | + foreach ($this->plans as $plan) { |
|
| 21 | + switch ($plan->nickname) { |
|
| 22 | 22 | case 'UTY': |
| 23 | 23 | $plan->title = '50GBP for unlimited trees yearly'; |
| 24 | 24 | break; |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | $user = auth()->user(); |
| 66 | 66 | $user->syncRoles('OTY'); |
| 67 | 67 | $plan_id = request()->plan_id; |
| 68 | - if(request()->has('payment_method')) { |
|
| 68 | + if (request()->has('payment_method')) { |
|
| 69 | 69 | $paymentMethod = request()->payment_method; |
| 70 | - $user->newSubscription('default', $plan_id)->create($paymentMethod,['name' => request()->card_holder_name, "address" => ["country" => 'GB', "state" => 'England', "city" => 'Abberley', "postal_code" => 'WR6', "line1" => 'test', "line2" => ""]]); |
|
| 70 | + $user->newSubscription('default', $plan_id)->create($paymentMethod, ['name' => request()->card_holder_name, "address" => ["country" => 'GB', "state" => 'England', "city" => 'Abberley', "postal_code" => 'WR6', "line1" => 'test', "line2" => ""]]); |
|
| 71 | 71 | $user->notify(new SubscribeSuccessfully($plan_id)); |
| 72 | - } else if($user->hasDefaultPaymentMethod()) { |
|
| 72 | + } else if ($user->hasDefaultPaymentMethod()) { |
|
| 73 | 73 | $paymentMethod = $user->defaultPaymentMethod(); |
| 74 | 74 | $user->newSubscription('default', $plan_id)->create($paymentMethod->id); |
| 75 | 75 | $user->notify(new SubscribeSuccessfully($plan_id)); |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | public function webhook() { |
| 92 | 92 | $data = request()->all(); |
| 93 | 93 | $user = User::where('stripe_id', $data['data']['object']['customer'])->first(); |
| 94 | - if($user) { |
|
| 94 | + if ($user) { |
|
| 95 | 95 | $plan_nickname = $data['data']['object']['items']['data'][0]['plan']['nickname']; |
| 96 | - foreach($this->plans as $plan) { |
|
| 97 | - if($plan->nickname == $plan_nickname) { |
|
| 98 | - switch($plan->nickname) { |
|
| 96 | + foreach ($this->plans as $plan) { |
|
| 97 | + if ($plan->nickname == $plan_nickname) { |
|
| 98 | + switch ($plan->nickname) { |
|
| 99 | 99 | case 'UTY': |
| 100 | 100 | $user->syncRoles('UTY'); |
| 101 | 101 | break; |
@@ -18,34 +18,34 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $query = Dna::query(); |
| 20 | 20 | |
| 21 | - if($request->has('searchTerm')) { |
|
| 21 | + if ($request->has('searchTerm')) { |
|
| 22 | 22 | $columnsToSearch = ['name']; |
| 23 | 23 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 24 | - if(!empty($search_term)) { |
|
| 24 | + if (!empty($search_term)) { |
|
| 25 | 25 | $searchQuery = '%' . $search_term . '%'; |
| 26 | - foreach($columnsToSearch as $column) { |
|
| 26 | + foreach ($columnsToSearch as $column) { |
|
| 27 | 27 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if($request->has('columnFilters')) { |
|
| 32 | + if ($request->has('columnFilters')) { |
|
| 33 | 33 | |
| 34 | 34 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 35 | 35 | |
| 36 | - foreach($filters as $key => $value) { |
|
| 37 | - if(!empty($value)) { |
|
| 36 | + foreach ($filters as $key => $value) { |
|
| 37 | + if (!empty($value)) { |
|
| 38 | 38 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if($request->has('sort.0')) { |
|
| 43 | + if ($request->has('sort.0')) { |
|
| 44 | 44 | $sort = json_decode($request->sort[0]); |
| 45 | 45 | $query->orderBy($sort->field, $sort->type); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if($request->has("perPage")) { |
|
| 48 | + if ($request->has("perPage")) { |
|
| 49 | 49 | $rows = $query->paginate($request->perPage); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -152,8 +152,7 @@ |
||
| 152 | 152 | 'message' => __('The dna was successfully deleted'), |
| 153 | 153 | 'redirect' => 'dna.index', |
| 154 | 154 | ]; |
| 155 | - } |
|
| 156 | - else |
|
| 155 | + } else |
|
| 157 | 156 | { |
| 158 | 157 | return [ |
| 159 | 158 | 'message' => __('The dna could not be deleted'), |
@@ -16,34 +16,34 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $query = Note::query(); |
| 18 | 18 | |
| 19 | - if($request->has('searchTerm')) { |
|
| 20 | - $columnsToSearch = ['note', 'rin', 'name','description','is_active','type_id','group']; |
|
| 19 | + if ($request->has('searchTerm')) { |
|
| 20 | + $columnsToSearch = ['note', 'rin', 'name', 'description', 'is_active', 'type_id', 'group']; |
|
| 21 | 21 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 22 | - if(!empty($search_term)) { |
|
| 22 | + if (!empty($search_term)) { |
|
| 23 | 23 | $searchQuery = '%' . $search_term . '%'; |
| 24 | - foreach($columnsToSearch as $column) { |
|
| 24 | + foreach ($columnsToSearch as $column) { |
|
| 25 | 25 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($request->has('columnFilters')) { |
|
| 30 | + if ($request->has('columnFilters')) { |
|
| 31 | 31 | |
| 32 | 32 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 33 | 33 | |
| 34 | - foreach($filters as $key => $value) { |
|
| 35 | - if(!empty($value)) { |
|
| 34 | + foreach ($filters as $key => $value) { |
|
| 35 | + if (!empty($value)) { |
|
| 36 | 36 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if($request->has('sort.0')) { |
|
| 41 | + if ($request->has('sort.0')) { |
|
| 42 | 42 | $sort = json_decode($request->sort[0]); |
| 43 | 43 | $query->orderBy($sort->field, $sort->type); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if($request->has("perPage")) { |
|
| 46 | + if ($request->has("perPage")) { |
|
| 47 | 47 | $rows = $query->paginate($request->perPage); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | public function destroy($id) |
| 143 | 143 | { |
| 144 | 144 | $note = Note::find($id); |
| 145 | - if($note) { |
|
| 145 | + if ($note) { |
|
| 146 | 146 | $note->delete(); |
| 147 | 147 | return "true"; |
| 148 | 148 | } |
@@ -16,39 +16,39 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function index(Request $request) |
| 18 | 18 | { |
| 19 | - $query = Family::query()->with(['husband','wife']); |
|
| 19 | + $query = Family::query()->with(['husband', 'wife']); |
|
| 20 | 20 | |
| 21 | - if($request->has('searchTerm')) { |
|
| 22 | - $columnsToSearch = ['description', 'is_active', 'husband_id','wife_id','type_id','chan','nchi','rin']; |
|
| 21 | + if ($request->has('searchTerm')) { |
|
| 22 | + $columnsToSearch = ['description', 'is_active', 'husband_id', 'wife_id', 'type_id', 'chan', 'nchi', 'rin']; |
|
| 23 | 23 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 24 | - if(!empty($search_term)) { |
|
| 24 | + if (!empty($search_term)) { |
|
| 25 | 25 | $searchQuery = '%' . $search_term . '%'; |
| 26 | - foreach($columnsToSearch as $column) { |
|
| 26 | + foreach ($columnsToSearch as $column) { |
|
| 27 | 27 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if($request->has('columnFilters')) { |
|
| 32 | + if ($request->has('columnFilters')) { |
|
| 33 | 33 | |
| 34 | 34 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 35 | 35 | |
| 36 | - foreach($filters as $key => $value) { |
|
| 37 | - if(!empty($value)) { |
|
| 36 | + foreach ($filters as $key => $value) { |
|
| 37 | + if (!empty($value)) { |
|
| 38 | 38 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if($request->has('sort.0')) { |
|
| 43 | + if ($request->has('sort.0')) { |
|
| 44 | 44 | $sort = json_decode($request->sort[0]); |
| 45 | 45 | $query->orderBy($sort->field, $sort->type); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if($request->has("perPage")) { |
|
| 48 | + if ($request->has("perPage")) { |
|
| 49 | 49 | $rows = $query->paginate($request->perPage); |
| 50 | 50 | } |
| 51 | - if(!count($request->all())) { |
|
| 51 | + if (!count($request->all())) { |
|
| 52 | 52 | $rows = $query->get(); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function create() |
| 64 | 64 | { |
| 65 | - $male = Person::where('sex','M')->get(); |
|
| 66 | - $female = Person::where('sex','F')->get(); |
|
| 65 | + $male = Person::where('sex', 'M')->get(); |
|
| 66 | + $female = Person::where('sex', 'F')->get(); |
|
| 67 | 67 | $types = DB::table('types')->get(); |
| 68 | - return response()->json(['male' => $male, 'female' => $female , 'types' => $types]); |
|
| 68 | + return response()->json(['male' => $male, 'female' => $female, 'types' => $types]); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | public function destroy($id) |
| 164 | 164 | { |
| 165 | 165 | $family = Family::find($id); |
| 166 | - if($family) { |
|
| 166 | + if ($family) { |
|
| 167 | 167 | $family->delete(); |
| 168 | 168 | return "true"; |
| 169 | 169 | } |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public function index() { |
| 11 | 11 | |
| 12 | - return auth()->user()->getAllPermissions()->pluck('name'); |
|
| 12 | + return auth()->user()->getAllPermissions()->pluck('name'); |
|
| 13 | 13 | } |
| 14 | - public function getPermission(Request $request) { |
|
| 15 | - $query = Permission::query(); |
|
| 14 | + public function getPermission(Request $request) { |
|
| 15 | + $query = Permission::query(); |
|
| 16 | 16 | |
| 17 | 17 | if($request->has('searchTerm')) { |
| 18 | 18 | $columnsToSearch = ['name']; |
@@ -14,37 +14,37 @@ |
||
| 14 | 14 | public function getPermission(Request $request) { |
| 15 | 15 | $query = Permission::query(); |
| 16 | 16 | |
| 17 | - if($request->has('searchTerm')) { |
|
| 17 | + if ($request->has('searchTerm')) { |
|
| 18 | 18 | $columnsToSearch = ['name']; |
| 19 | 19 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 20 | - if(!empty($search_term)) { |
|
| 20 | + if (!empty($search_term)) { |
|
| 21 | 21 | $searchQuery = '%' . $search_term . '%'; |
| 22 | - foreach($columnsToSearch as $column) { |
|
| 22 | + foreach ($columnsToSearch as $column) { |
|
| 23 | 23 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - if($request->has('columnFilters')) { |
|
| 28 | + if ($request->has('columnFilters')) { |
|
| 29 | 29 | |
| 30 | 30 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 31 | 31 | |
| 32 | - foreach($filters as $key => $value) { |
|
| 33 | - if(!empty($value)) { |
|
| 32 | + foreach ($filters as $key => $value) { |
|
| 33 | + if (!empty($value)) { |
|
| 34 | 34 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if($request->has('sort.0')) { |
|
| 39 | + if ($request->has('sort.0')) { |
|
| 40 | 40 | $sort = json_decode($request->sort[0]); |
| 41 | 41 | $query->orderBy($sort->field, $sort->type); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if($request->has("perPage")) { |
|
| 44 | + if ($request->has("perPage")) { |
|
| 45 | 45 | $rows = $query->paginate($request->perPage); |
| 46 | 46 | } |
| 47 | - if(!count($request->all())) { |
|
| 47 | + if (!count($request->all())) { |
|
| 48 | 48 | $rows = $query->get()->toArray(); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -16,34 +16,34 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $query = SourceData::query(); |
| 18 | 18 | |
| 19 | - if($request->has('searchTerm')) { |
|
| 20 | - $columnsToSearch = ['group','date', 'text','agnc']; |
|
| 19 | + if ($request->has('searchTerm')) { |
|
| 20 | + $columnsToSearch = ['group', 'date', 'text', 'agnc']; |
|
| 21 | 21 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 22 | - if(!empty($search_term)) { |
|
| 22 | + if (!empty($search_term)) { |
|
| 23 | 23 | $searchQuery = '%' . $search_term . '%'; |
| 24 | - foreach($columnsToSearch as $column) { |
|
| 24 | + foreach ($columnsToSearch as $column) { |
|
| 25 | 25 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($request->has('columnFilters')) { |
|
| 30 | + if ($request->has('columnFilters')) { |
|
| 31 | 31 | |
| 32 | 32 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 33 | 33 | |
| 34 | - foreach($filters as $key => $value) { |
|
| 35 | - if(!empty($value)) { |
|
| 34 | + foreach ($filters as $key => $value) { |
|
| 35 | + if (!empty($value)) { |
|
| 36 | 36 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if($request->has('sort.0')) { |
|
| 41 | + if ($request->has('sort.0')) { |
|
| 42 | 42 | $sort = json_decode($request->sort[0]); |
| 43 | 43 | $query->orderBy($sort->field, $sort->type); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if($request->has("perPage")) { |
|
| 46 | + if ($request->has("perPage")) { |
|
| 47 | 47 | $rows = $query->paginate($request->perPage); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function destroy($id) |
| 136 | 136 | { |
| 137 | 137 | $sourcedata = SourceData::find($id); |
| 138 | - if($sourcedata) { |
|
| 138 | + if ($sourcedata) { |
|
| 139 | 139 | $sourcedata->delete(); |
| 140 | 140 | return "true"; |
| 141 | 141 | } |
@@ -16,34 +16,34 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $query = Place::query(); |
| 18 | 18 | |
| 19 | - if($request->has('searchTerm')) { |
|
| 19 | + if ($request->has('searchTerm')) { |
|
| 20 | 20 | $columnsToSearch = ['name', 'email', 'phone']; |
| 21 | 21 | $search_term = json_decode($request->searchTerm)->searchTerm; |
| 22 | - if(!empty($search_term)) { |
|
| 22 | + if (!empty($search_term)) { |
|
| 23 | 23 | $searchQuery = '%' . $search_term . '%'; |
| 24 | - foreach($columnsToSearch as $column) { |
|
| 24 | + foreach ($columnsToSearch as $column) { |
|
| 25 | 25 | $query->orWhere($column, 'LIKE', $searchQuery); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($request->has('columnFilters')) { |
|
| 30 | + if ($request->has('columnFilters')) { |
|
| 31 | 31 | |
| 32 | 32 | $filters = get_object_vars(json_decode($request->columnFilters)); |
| 33 | 33 | |
| 34 | - foreach($filters as $key => $value) { |
|
| 35 | - if(!empty($value)) { |
|
| 34 | + foreach ($filters as $key => $value) { |
|
| 35 | + if (!empty($value)) { |
|
| 36 | 36 | $query->orWhere($key, 'like', '%' . $value . '%'); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if($request->has('sort.0')) { |
|
| 41 | + if ($request->has('sort.0')) { |
|
| 42 | 42 | $sort = json_decode($request->sort[0]); |
| 43 | 43 | $query->orderBy($sort->field, $sort->type); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if($request->has("perPage")) { |
|
| 46 | + if ($request->has("perPage")) { |
|
| 47 | 47 | $rows = $query->paginate($request->perPage); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function destroy($id) |
| 134 | 134 | { |
| 135 | 135 | $place = Place::find($id); |
| 136 | - if($place) { |
|
| 136 | + if ($place) { |
|
| 137 | 137 | $place->delete(); |
| 138 | 138 | return "true"; |
| 139 | 139 | } |