Created
March 10, 2020 15:27
-
-
Save eimkasp/3d87a0a22c819dfd5448361ecf8e65e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function store( Request $request ) { | |
// | |
$newsItem = new NewsItem(); | |
$newsItem->title = $request->input('title'); | |
$newsItem->content = $request->input('content'); | |
$newsItem->image = ""; | |
// sita eilute grazina prisijungusio vartotojo ID | |
// jei naudoju Auth::user(), tai virsui nepamirsti parasyti use Auth; | |
$newsItem->user_id = Auth::user()->id; | |
$newsItem->save(); | |
return redirect()->route('news.show', $newsItem->id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment