/** * Save edited page * * @return mixed */ public function postEditpage() { $page_id = Input::get('page_id'); if ($page_id > 0) { $page = CatraPage::find($page_id); } else { $page = new Page(); } $page->page_title = trim(Input::get('page_title')); $page->active = Input::get('active'); $page->page_content = trim(Input::get('page_content')); $page->meta = Input::get('meta'); $page->meta_tags = Input::get('meta_tags'); $page->slug = Str::slug(trim(Input::get('page_title'))); if (Input::has('page_title_fr')) { $page->page_title_fr = Input::get('page_title_fr'); $page->page_content_fr = Input::get('page_content_fr'); $page->slug = Str::slug(trim(Input::get('page_title'))); } if (Input::has('page_title_es')) { $page->page_title_es = Input::get('page_title_es'); $page->page_content_es = Input::get('page_content_es'); $page->slug_es = Str::slug(trim(Input::get('page_title_es'))); } $page->save(); $page_id = $page->id; // make sure we have a page details entry $detail = PageDetail::where('page_id', '=', $page->id)->first(); if ($detail == null) { $detail = new PageDetail(); } $detail->page_id = $page_id; $detail->page_category_id = Input::get("page_category_id"); $detail->save(); Cache::flush(); return Redirect::to('/admin/page/all-pages')->with('message', 'Page saved successfully'); }
Route::get('/flushcache', function () { \Illuminate\Support\Facades\Cache::flush(); if (Input::has('target')) { return \Illuminate\Support\Facades\Redirect::to(Input::get('target')); } else { return \Illuminate\Support\Facades\Redirect::back(); } }); Route::get('/forum', function () { return \Illuminate\Support\Facades\Redirect::to('http://forums.catraonline.ca'); }); Route::get('/forums', function () { return \Illuminate\Support\Facades\Redirect::to('http://forums.catraonline.ca'); }); Route::get('/test', function () { $page = \App\CatraPage::find(2); dd($page->pageDetails()->id); }); // gallery Route::get('/gallery', 'GalleryController@getAllItems'); Route::get('/province', 'ProvincesController@getProvince'); Route::get('/contact', 'ContactController@getContact'); Route::post('/contact', 'ContactController@postContact'); Route::get('/national-data', 'CatraPageController@showProgramPage'); Route::get('/provincial-data', 'CatraPageController@showProvincialData'); // calendar & events Route::get('/calendar-events', 'EventsController@showCal'); Route::get('/calendar', 'EventsController@showCal'); Route::get('/events-calendar', 'EventsController@showCal'); Route::get('/upcoming', 'EventsController@showCal'); Route::get('/event/{id}/{title?}', 'EventsController@showEvent');