示例#1
0
 public function getOrm()
 {
     $users = User::first();
     dd($users->last_name);
 }
示例#2
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }
示例#3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, Request $request)
 {
     $user = User::findOrFail($id);
     $user->delete();
     $message = 'El usuario: ' . $user->full_name . ' fue eliminado de los registros';
     if ($request->ajax()) {
         //return $message;
         return response()->json(['message' => $message, 'id' => $user->id]);
     }
     \Session::flash('message', $message);
     //Redireccion a la lista de usuarios
     return redirect()->route('admin.users.index');
 }