Breaking News: Grepper is joining
You.com.
Read the official announcement!
Check it out
SEARCH
COMMUNITY
API
DOCS
INSTALL GREPPER
Log In
Signup
Jocelyn
May 18, 2022
Twitter
Facebook
Reddit
Hacker News
LinkedIn
Upload Image Laravel
# if your Model Name is Post $filename = ""; if($request->file('image')) { //This code get image from your form input of type file and name="image" and move it in public/Images folder $file = $request->file('image'); $filename = date('YmdHis')."_". $file->getClientOriginalName(); $file->move(public_path('Images'), $filename); } //This code save image name in your database on Posts table Post::create([ 'title'=>"your title", "content" => "your content", "image" => $filename ]);