Laravel: File Upload Controller

public function store() { if(Input::hasFile('image')) { $destinationPath = base_path() . "/public/images/works/"; $name = Input::file('image')->getClientOriginalName(); Input::file('image')->move($destinationPath, $name); } $work=Input::all(); $work['image'] = $name; Work::create( $work ); return redirect('work/list')->with('message', 'Work created'); }

1 Response

asdasdasdasd

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.