/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $editcountry = Country::whereId($id)->first(); $country = Country::paginate(10); $country->setpath(''); return view('setting/country')->with('editcountry', $editcountry)->with('id', $id)->with('country', $country); }
/** * Display a listing of the resource. * * @return Response */ public function index(Request $request) { $links[1] = 'active'; $isFiltering = false; if ($request->filter) { $countries = DB::table('countries')->where('continent', $request->filter)->paginate(15); $countries->setPath("countries?filter={$request->filter}"); $isFiltering = true; } else { $countries = Country::paginate(15); } return view('country.index', ['countries' => $countries, 'links' => $links, 'isFiltering' => $isFiltering]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $this->validate($request, ['search' => 'string|max:20']); if ($request->has('search')) { $search = $request->input('search'); $countries = Country::whereHas('translations', function ($query) use($search) { $query->where('name', 'like', $search . '%'); })->paginate(15); } else { $countries = Country::paginate(15); } if ($request->wantsJSON()) { return response()->json($countries->toArray(), 200); } else { return view('pages.country.index', ['countries' => $countries]); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $country = Country::paginate(); return view('settings.countrys.index', compact('country')); }
public function countries() { $data['result'] = Country::paginate(10); return view('admin.location.countries', $data); }