Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public function update(Request $request, $show)
  2. {
  3.  
  4. if ($request->hasFile('file')) {
  5. $photoRubric = $request->file('file');
  6. $filename = "public/img/articles/" . time() . '.' . $photoRubric->getClientOriginalExtension();
  7. Image::make($photoRubric)->resize(300, 300)->save($filename);
  8. } else {
  9. $filename = Article::find($show)->images;
  10. }
  11. Article::where('article_id', $show)
  12. ->update([
  13. 'title' => $request->name,
  14. 'description' => $request->description,
  15. 'author_id'->Auth::user()->id,
  16. 'images' => $filename,
  17. 'rubric_id' => Rubric::where('title', $request->taskOption)->get()[0]->id,
  18. 'updated_at' => date("Y-m-d H:i:s")
  19. ]);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement