Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function update(Request $request, $show)
- {
- if ($request->hasFile('file')) {
- $photoRubric = $request->file('file');
- $filename = "public/img/articles/" . time() . '.' . $photoRubric->getClientOriginalExtension();
- Image::make($photoRubric)->resize(300, 300)->save($filename);
- } else {
- $filename = Article::find($show)->images;
- }
- Article::where('article_id', $show)
- ->update([
- 'title' => $request->name,
- 'description' => $request->description,
- 'author_id'->Auth::user()->id,
- 'images' => $filename,
- 'rubric_id' => Rubric::where('title', $request->taskOption)->get()[0]->id,
- 'updated_at' => date("Y-m-d H:i:s")
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement