Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function store()
- {
- // move this to a "emailExists() method or something.
- if (Farmer::where('email', Input::get('email')->first()) {
- return $farmer->id;
- }
- // bad (use validation, input::only, or make sure you guard eloquent model)
- $arr = Input::all();
- // use a mutator on your model and get rid of this line also
- $arr['dob'] = \Carbon::createFromTimeStamp(strtotime($arr['dob'])));
- return $this->respondCreated(Farmer::create($arr));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement