コード例 #1
0
ファイル: NewsController.php プロジェクト: Tisho84/conference
 /**
  * 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]);
 }