Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. $validator = Validator::make(request()->all(),[
  2.                         'title' => 'required',
  3.                     'description' => 'required',
  4.             ]);
  5.             if(!$validator->fails() && auth()->check()){
  6.                 Project::create([
  7.                     'title' => request('title'),
  8.                     'description' => request('description'),
  9.                     'owner_id'=> auth()->id()
  10.                 ]);
  11.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement