50 lines
870 B
PHP
Executable File
50 lines
870 B
PHP
Executable File
<?php namespace App\Http\Controllers;
|
|
|
|
use App\User;
|
|
use Input;
|
|
|
|
class ReferentController extends Controller {
|
|
|
|
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Show the application dashboard to the user.
|
|
*
|
|
* @return Response
|
|
*/
|
|
public function index()
|
|
{
|
|
$me = User::current();
|
|
$user = User::all();
|
|
return view('referent', ['nameRoute' => 'Référent', 'me' => $me]);
|
|
}
|
|
|
|
/**
|
|
* updateUser an user in database.
|
|
*
|
|
*
|
|
*/
|
|
public function update()
|
|
{
|
|
$user = User::find(Input::get('idUser'));
|
|
|
|
$user->firstname = Input::get('firstname');
|
|
$user->email = Input::get('email');
|
|
$user->city = Input::get('city');
|
|
$user->lastname = Input::get('lastname');
|
|
|
|
$user->save();
|
|
return redirect('/referent')->with('message_update', 'Referent mis à jour avec succès');
|
|
}
|
|
|
|
}
|