I was writing code to let only admins register
RegisterBlade accessed after editing cannot be displayed
I checked and found that the ReflectionClass was gone
But I want you to tell me because I can't do anything more
Rewritten location
RegistersUsers
return redirect(route('user.index'));
//$this->guard()->login($user);
// return $this->registered($request, $user)
// ?: redirect($this->redirectPath());
RegisterController
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'role' => $data['role'],
]);
}
and
web.php
Route::group(['middleware' => ['auth', 'can:system-only']], function () {
Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController@register');
Route::get('/home/user/create', 'UserContoroller@create')->name('user.create');
Route::post('/home/user/create', 'UserContoroller@store')->name('user.store');
});
Here is line 788
class Container implements ArrayAccess, ContainerContract
public function build($concrete)
{
// If the concrete type is actually a Closure, we will just execute it and
// hand back the results of the functions, which allows functions to be
// used as resolvers for more fine-tuned resolution of these objects.
if ($concrete instanceof Closure) {
return $concrete($this, $this->getLastParameterOverride());
}
$reflector = new ReflectionClass($concrete);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire