atcheck/app/Http/Controllers/Admin/AdminUsersController.php

41 lines
896 B
PHP
Raw Normal View History

2019-12-01 19:31:49 +01:00
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\User;
use App\Subject;
use App\Room;
use App\Classes;
use App\Attendance;
class AdminUsersController extends Controller
{
public function index()
{
$users = User::all();
return view('admin.admin_users', ['users' => $users]);
}
public function add_user(Request $request)
{
$name = $request->input('name');
$surname = $request->input('surname');
$id_number = $request->input('id_number');
return redirect(route('admin_users'));
}
public function delete_user($user_id)
{
User::find($user_id)->delete();
return redirect(route('admin_users'));
}
public function edit_user($user_id)
{
User::find($user_id);
return redirect(route('admin_users'));
}
}