/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { // Retrieve all pages $pages = Page::all(); // Bind them to view $view->with('pages', $pages); }
function getIndex() { $pages = Page::all(); $user = Auth::user(); $users = $user_groups = $user->type === 0; return view('panel.intro', ['pages' => Page::all(), 'user' => Auth::user(), 'user_groups' => $user_groups, 'users' => $users]); }
public function __construct() { $this->data['categories'] = Products\Category::where('status', '!=', 0)->GetNested(); $this->data['products'] = Products\Product::where('product_status', '!=', 0)->take(shopOpt('product_perpage_front'))->get(); $this->data['mtop'] = Page\Page::where('page_status', 1)->where('page_position', '=', 'top')->GetNested('top'); $this->data['mbottom'] = Page\Page::where('page_status', 1)->where('page_position', '=', 'bottom')->GetNested('bottom'); $this->data['slideshow'] = Widget\Slideshow::where('ss_status', 1)->orderBy('ss_order')->get(); }
/** * Execute the command. * * @return void */ public function handle() { $page = Page::where('slug', $this->old_slug)->first(); $page->name = $this->name; $page->slug = $this->slug; $page->content = $this->content; $page->save(); }
/** * Define your route model bindings, pattern filters, etc. * * @param \Illuminate\Routing\Router $router * @return void */ public function boot(Router $router) { parent::boot($router); $router->bind('category', function ($slug) { return Category::where('slug', $slug)->first(); }); $router->bind('post', function ($slug) { return Post::where('slug', $slug)->first(); }); $router->bind('page', function ($slug) { return Page::where('slug', $slug)->first(); }); }
function getCreateAll() { $db = Database::import_or_new(NULL); $tables = $db->tables; foreach ($tables as $table) { $page_name = $table->name; $page = Page::import_or_new_with($page_name, ['db' => $db, 'base_table' => $table]); if ($page->is_imported) { continue; } $table = $page->table($table->name); $page->user_group_permissions(""); $page->export(); } return redirect()->action("TableController@getIndex")->with('message_type', 'success')->with('message', 'Success!'); }
public function show($slug) { // $findcat = Products\Category::with('product')->where('slug', $slug)->first(); if (count($findcat) == 0) { $findpro = Products\Product::where('slug', $slug)->first(); $this->data['product'] = $findpro; $this->data['related_product'] = Products\Product::where('id_category', $findpro->id_category)->where('id', '!=', $findpro->id)->get(); if (count($findpro) > 0) { return view('front.eshopper.pages.product', $this->data); } } else { $this->data['products'] = $findcat->product()->paginate(5); return view('front.eshopper.pages.category', $this->data); } $this->data['page'] = Page\Page::where('page_slug', $slug)->first(); if (count($this->data['page'])) { return view('front.eshopper.pages.pages', $this->data); } return abort('404', 'Page Not Found'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // if (!Entrust::can('page-delete')) { return response()->json(['success' => FALSE]); } $page = Page::find($id); if ($page->delete()) { $page->where('page_parent', $id)->update(['page_parent' => 0]); return response()->json(['success' => TRUE]); } }
/** * Execute the command. * * @return void */ public function handle() { Page::where('slug', $this->slug)->first()->delete(); }
function getListMore($page_name) { $page = unref(Page::import($page_name)); if ($r = $this->user_accessibility($page, '>')) { return $r; } $table_name = Input::get('table'); $col = Input::get('col'); $offset = Input::get('offset'); $list_values = DisplayTable::import($table_name)->select_list_values($col, 20, $offset); $next_query = NULL; if (count($list_values) == 20) { $all = Input::all(); $all['offset'] = intval($all['offset']) + 20; $next_query = http_build_query($all); } return view('panel.data.list-more-values', ['list_values' => $list_values, 'next_query' => $next_query]); }
/** * Execute the command. * * @return void */ public function handle() { Page::create(['name' => $this->name, 'slug' => $this->slug, 'content' => $this->content]); }