Uzyskaj URI żądania od żądania Laravel 7
Try to use the following:
\Request::getRequestUri()
Lokesh003Coding
Try to use the following:
\Request::getRequestUri()
public function store(StorePostRequest $request)
{
$request->validate([
//unique:table,column
"title" => "required|unique:posts,title|min:5",
"description" => "required|min:15",
"cover" => "required|file|mimes:jpeg,png|max:5000"
]);
//photo Save in local
$newName = "cover_".uniqid()."_".$request->file('cover')->extension();
$request->file('cover')->storeAs("public/cover",$newName);
//store in database
$post = new Post();
$post->title = $request->title;
$post->slug = Str::slug($request->title);
$post->description = $request->description;
$post->excerpt = Str::words($request->description,50);
$post->cover = $newName;
$post->user_id = Auth::id();
$post->save();
return redirect()->route("index")->with('status','Post Created');
return $request;
}
$request->input('name');
$request->input('user.name'); // fetch from user object
$request->fullUrl()