/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function IndexAction()
 {
     $this->name = Input::get('name');
     $this->status = Input::get('status');
     $this->country = Country::select('id', 'name', 'image', 'status')->where('name', 'like', '%' . $this->name . '%')->where('status', 'like', '%' . $this->status . '%')->paginate(5);
     /*MyHelper::debug($this->country->toArray(),1);die;*/
     return view('admin/country/country_list', ['country' => $this->country]);
 }
 /** Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function EditAction($id)
 {
     $this->data = Package::find($id);
     if (!$this->data) {
         return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'Package Id could not found']));
     }
     /*find category id with the help of package table*/
     $this->category = category::find($this->data->category_id);
     /*if id match then select the country which is lies in the table */
     $this->categories = category::select('id', 'name')->where('country_id', $this->category->country_id)->get();
     $this->country = Country::select('id', 'name')->orderBy('name', 'asc')->get();
     return view('admin.package.package_edit', ['datas' => $this->data, 'country' => $this->country, 'category' => $this->category, 'categories' => $this->categories]);
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->site_infos = Site_infos::first();
     $this->destination = Country::select('id', 'name', 'url')->where('status', 'Active')->get();
     $this->menu = Page::where('status', 'Active')->where('parent_id', 0)->where('status', 'Active')->get();
     /**
      * find parent id on the menu and concatenate related sub menu to Array
      * */
     foreach ($this->menu as $key => $m) {
         $this->menu[$key]->sub_menu = Page::where('parent_id', $m->id)->where('status', 'Active')->get()->toArray();
     }
     /**
      * find the country related category
      */
     foreach ($this->destination as $key => $d) {
         $this->destination[$key]->category = category::select('name', 'url')->where('country_id', $d->id)->where('status', 'Active')->get()->toArray();
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function EditAction($id)
 {
     $this->category = category::find($id);
     return view('admin.category.category_edit', ['country' => Country::select('name', 'id')->orderBy('name', 'asc')->get(), 'category' => $this->category]);
 }