app/Http/Controllers/UsersController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Users  $Users
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $user = User::findOrFail($id);
        $role = $user->role;
        if(Auth::user()->role=='Administrador'){
        User::destroy($id);
        }
        return redirect('/users?role='.$role)->with('deleteSuccess','El usuario ha sido eliminado');
    }
public function destroy ( $ id ) { $ user = User :: findOrFail ( $ id ) ; $ role = $ user -> role ; if ( Auth :: user ( ) -> role == 'Administrador' ) { User :: destroy ( $ id ) ; } return redirect ( '/users?role=' . $ role ) -> with ( 'deleteSuccess' , 'El usuario ha sido eliminado' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .