LoginSignup
0
0

【Laravel】編集機能完了→詳細ページへのリダイレクト方法

Posted at

コード

SpendingController.php
    public function update(Request $request, int $id)
    {
        $record = Auth::user()->spending()->find($id);

        $record->amount = $request->amount;
        $record->date = $request->date;
        $record->title = $request->title;
        
        Auth::user()->spending()->save($record);

        ⭐️これ
        return redirect()->route('spending.show', ['spending' =>  $id]);
    }

参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0