コード例 #1
0
ファイル: ScenesController.php プロジェクト: katjam/scenes
 /**
  * Show the form for editing the specified resource.
  *
  * @param  \Scenes\Scene
  * @return \Illuminate\Http\Response
  */
 public function edit(Scene $scene)
 {
     $settings = DB::table('settings')->select(DB::raw('CONCAT_WS(" - ", location, set_name) as loc_set_name, id'))->lists('loc_set_name', 'id');
     asort($settings);
     $all_characters = \Scenes\Character::all();
     $scn_chars = $scene->characters->lists('id')->all();
     return view('scenes.edit', compact('settings', 'scene', 'all_characters', 'scn_chars'));
 }
コード例 #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Scenes\Character
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Character $character)
 {
     $character->fill($request->all())->save();
     Session::flash('message', 'Successfully updated Character!');
     return Redirect::to('characters');
 }