Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public function store(Category $category, Path $path,$level,Task $task,Request $request)
  2. {
  3. Auth::loginUsingId(1);
  4.  
  5. $this->validate($request ,[
  6. 'body' =>'required|max:5000',
  7. ]);
  8.  
  9. $comment = $task->comments()->make([
  10. 'body' => $request->body
  11. ]);
  12.  
  13. $request->user()->comments()->save($comment);
  14.  
  15. return new CommentResource($comment);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement