eloquent - no request in view

This commit is contained in:
Malibu
2015-02-17 15:56:30 +01:00
parent 759b6a240e
commit 755f691478
6 changed files with 46 additions and 47 deletions

View File

@ -1,7 +1,6 @@
<?php namespace App\Http\Controllers;
use DB;
use Auth;
use App\User;
class AdminController extends Controller {
@ -23,11 +22,23 @@ class AdminController extends Controller {
*/
public function index()
{
$email = Auth::user()->email;
$me = DB::table('users')->where('email', $email)->first();
$user = DB::table('users')->where('name','<>',"admin")->get();
$me = User::current();
$user = User::all();
return view('admin', ['nameRoute' => 'Admin', 'users' => $user, 'me' => $me]);
}
/**
* Add an user in database.
*
*
*/
public function addUser()
{
$firstname = Request::input('firstname');
$lastname = Input::get('lastname');
$email = Input::get('email');
$city = Input::get('city');
//print('ok');
}
}