Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  \App\News $news
  * @return \Illuminate\Http\Response
  */
 public function edit(News $news)
 {
     $news->load('langs');
     foreach ($news->langs as $lang) {
         $title = 'title_' . systemTrans($lang['lang_id']);
         $description = 'description_' . systemTrans($lang['lang_id']);
         $news->{$title} = $lang['title'];
         $news->{$description} = $lang['description'];
     }
     return view('admin.news.edit', ['news' => $news]);
 }