Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $viDes = DesContent::find(1);
     $enDes = DesContent::find(2);
     $introduces = AdminLanguage::where('model_name', 'Introduce')->orderBy('position', 'asc')->get();
     // dd(LaravelLocalization::setLocale());
     return View::make('site.index')->with(compact('viDes', 'enDes', 'introduces'));
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $viInput = Input::only('title', 'description');
     DesContent::find(1)->update($viInput);
     $enInput['title'] = Input::get('en_title');
     $enInput['description'] = Input::get('en_description');
     DesContent::find(2)->update($enInput);
     return Redirect::action('DesContentController@edit', 1);
 }
 public function run()
 {
     DesContent::create(['title' => 'gioi thieu trang chu', 'description' => 'description gioi thieu trang chu', 'slug' => 'gioi-thieu-trang-chu']);
     DesContent::create(['title' => 'home about-us', 'description' => 'home description en', 'slug' => 'about-us-home']);
 }