Compare commits
No commits in common. "604d5a902cae39a2381f9f52ff931c450a4a0408" and "88c692bfe19ce8e063e74a7b6d7596ab2eec2fac" have entirely different histories.
604d5a902c
...
88c692bfe1
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Requests\StoreDocumentsOnlineRequest;
|
||||||
|
use App\Http\Requests\UpdateDocumentsOnlineRequest;
|
||||||
|
use App\Models\DocumentsOnline;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
class DocumentsOnlineController extends Controller
|
||||||
|
{
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$documentsOnline = DocumentsOnline::all();
|
||||||
|
return view('documents-online.index', compact('documentsOnline'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create(DocumentsOnline $documentOnline): View
|
||||||
|
{
|
||||||
|
if (Auth::guest()) {
|
||||||
|
abort(403);
|
||||||
|
}
|
||||||
|
$parent = $documentOnline;
|
||||||
|
return view('documents-online', compact('parent'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(StoreDocumentsOnlineRequest $request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(DocumentsOnline $doceumentsOnline)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit(DocumentsOnline $doceumentsOnline)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(UpdateDocumentsOnlineRequest $request, DocumentsOnline $doceumentsOnline)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(DocumentsOnline $doceumentsOnline)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,65 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Http\Requests\StoreOnlineDocumentsRequest;
|
|
||||||
use App\Http\Requests\UpdateOnlineDocumentsRequest;
|
|
||||||
use App\Models\OnlineDocuments;
|
|
||||||
use Illuminate\Contracts\View\Factory;
|
|
||||||
use Illuminate\Contracts\View\View;
|
|
||||||
use Illuminate\Foundation\Application;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
|
||||||
|
|
||||||
class OnlineDocumentsController extends Controller
|
|
||||||
{
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
$onlineDocuments = OnlineDocuments::all();
|
|
||||||
return view('online-documents.index', compact('onlineDocuments'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create(OnlineDocuments $documentOnline): View
|
|
||||||
{
|
|
||||||
if (Auth::guest()) {
|
|
||||||
abort(403);
|
|
||||||
}
|
|
||||||
$parent = $documentOnline;
|
|
||||||
return view('online-documents', compact('parent'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function store(StoreOnlineDocumentsRequest $request)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*/
|
|
||||||
public function show(OnlineDocuments $doceumentsOnline)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*/
|
|
||||||
public function edit(OnlineDocuments $doceumentsOnline)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(UpdateOnlineDocumentsRequest $request, OnlineDocuments $doceumentsOnline)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy(OnlineDocuments $doceumentsOnline)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,25 +4,16 @@ namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requests\UpdateUserRequest;
|
use App\Http\Requests\UpdateUserRequest;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Auth\Events\PasswordReset;
|
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
public function index(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
public function index(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
||||||
{
|
{
|
||||||
if (!Auth::user('admin')) {
|
|
||||||
abort(403, 'У вас нет прав доступа');
|
|
||||||
}
|
|
||||||
if (Auth::guest()) {
|
|
||||||
abort(403, 'Вы не авторизованы!');
|
|
||||||
}
|
|
||||||
$users = User::all();
|
$users = User::all();
|
||||||
return view('users.index', compact('users'));
|
return view('users.index', compact('users'));
|
||||||
}
|
}
|
||||||
|
@ -32,9 +23,7 @@ class UserController extends Controller
|
||||||
if (Auth::guest()) {
|
if (Auth::guest()) {
|
||||||
abort(403, 'Вы не авторизованы!');
|
abort(403, 'Вы не авторизованы!');
|
||||||
}
|
}
|
||||||
if (!Auth::user('admin')) {
|
|
||||||
abort(403, 'У вас нет прав доступа');
|
|
||||||
}
|
|
||||||
$validated = $request->validated();
|
$validated = $request->validated();
|
||||||
|
|
||||||
$user = new User();
|
$user = new User();
|
||||||
|
@ -48,9 +37,6 @@ class UserController extends Controller
|
||||||
|
|
||||||
public function create(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
public function create(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
||||||
{
|
{
|
||||||
if (!Auth::user('admin')) {
|
|
||||||
abort(403, 'У вас нет прав доступа');
|
|
||||||
}
|
|
||||||
if (Auth::guest()) {
|
if (Auth::guest()) {
|
||||||
abort(403, 'Вы не авторизованы!');
|
abort(403, 'Вы не авторизованы!');
|
||||||
}
|
}
|
||||||
|
@ -59,9 +45,6 @@ class UserController extends Controller
|
||||||
|
|
||||||
public function edit(User $user): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
public function edit(User $user): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
||||||
{
|
{
|
||||||
if (!Auth::user('admin')) {
|
|
||||||
abort(403, 'У вас нет прав доступа');
|
|
||||||
}
|
|
||||||
if (Auth::guest()) {
|
if (Auth::guest()) {
|
||||||
abort(403, 'Вы не авторизованы!');
|
abort(403, 'Вы не авторизованы!');
|
||||||
}
|
}
|
||||||
|
@ -70,19 +53,13 @@ class UserController extends Controller
|
||||||
|
|
||||||
public function update(UpdateUserRequest $request, User $user): RedirectResponse
|
public function update(UpdateUserRequest $request, User $user): RedirectResponse
|
||||||
{
|
{
|
||||||
if (!Auth::user('admin')) {
|
|
||||||
abort(403, 'У вас нет прав доступа');
|
|
||||||
}
|
|
||||||
if (Auth::guest()) {
|
if (Auth::guest()) {
|
||||||
abort(403, 'Вы не авторизованы!');
|
abort(403, 'Вы не авторизованы!');
|
||||||
}
|
}
|
||||||
|
|
||||||
$validated = $request->validated();
|
$validated = $request->validated();
|
||||||
|
|
||||||
$user->name = $validated['name'];
|
$user->fill($validated);
|
||||||
$user->password = Hash::make($validated['password']);
|
|
||||||
$user->email = $validated['email'];
|
|
||||||
$user->remember_token = Str::random(60);
|
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
return redirect()->route('users.index');
|
return redirect()->route('users.index');
|
||||||
|
@ -90,12 +67,6 @@ class UserController extends Controller
|
||||||
|
|
||||||
public function destroy(User $user): RedirectResponse
|
public function destroy(User $user): RedirectResponse
|
||||||
{
|
{
|
||||||
if (!Auth::user('admin')) {
|
|
||||||
abort(403, 'У вас нет прав доступа');
|
|
||||||
}
|
|
||||||
if (Auth::guest()) {
|
|
||||||
abort(403, 'Вы не авторизованы!');
|
|
||||||
}
|
|
||||||
$user->delete();
|
$user->delete();
|
||||||
|
|
||||||
return redirect()->route('users.index');
|
return redirect()->route('users.index');
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Http\Requests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
class StoreOnlineDocumentsRequest extends FormRequest
|
class StoreDocumentsOnlineRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
|
@ -25,7 +25,7 @@ class StoreUserRequest extends FormRequest
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => 'required|unique:users,name|max:255',
|
'name' => 'required|unique:users,name|max:255',
|
||||||
'email' => 'email',
|
'email' => 'email:rfc,dns',
|
||||||
'password' => 'required'
|
'password' => 'required'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Http\Requests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
class UpdateOnlineDocumentsRequest extends FormRequest
|
class UpdateDocumentsOnlineRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
|
@ -24,8 +24,8 @@ class UpdateUserRequest extends FormRequest
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => 'required|max:255',
|
'name' => 'required|unique:users,name|max:255',
|
||||||
'email' => 'email',
|
'email' => 'email:rfc,dns',
|
||||||
'password' => 'required'
|
'password' => 'required'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,14 @@ namespace App\Models;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class OnlineDocuments extends Model
|
class DocumentsOnline extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
'url',
|
'description',
|
||||||
'parent',
|
'url'
|
||||||
'children'
|
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -31,6 +31,7 @@ class User extends Authenticatable
|
||||||
* @var array<int, string>
|
* @var array<int, string>
|
||||||
*/
|
*/
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
|
'password',
|
||||||
'remember_token',
|
'remember_token',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\OnlineDocuments;
|
use App\Models\DocumentsOnline;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Auth\Access\Response;
|
use Illuminate\Auth\Access\Response;
|
||||||
|
|
||||||
class OnlineDocumentsPolicy
|
class DocumentsOnlinePolicy
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine whether the user can view any models.
|
* Determine whether the user can view any models.
|
||||||
|
@ -19,7 +19,7 @@ class OnlineDocumentsPolicy
|
||||||
/**
|
/**
|
||||||
* Determine whether the user can view the model.
|
* Determine whether the user can view the model.
|
||||||
*/
|
*/
|
||||||
public function view(User $user, OnlineDocuments $doceumentsOnline): bool
|
public function view(User $user, DocumentsOnline $doceumentsOnline): bool
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class OnlineDocumentsPolicy
|
||||||
/**
|
/**
|
||||||
* Determine whether the user can update the model.
|
* Determine whether the user can update the model.
|
||||||
*/
|
*/
|
||||||
public function update(User $user, OnlineDocuments $doceumentsOnline): bool
|
public function update(User $user, DocumentsOnline $doceumentsOnline): bool
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ class OnlineDocumentsPolicy
|
||||||
/**
|
/**
|
||||||
* Determine whether the user can delete the model.
|
* Determine whether the user can delete the model.
|
||||||
*/
|
*/
|
||||||
public function delete(User $user, OnlineDocuments $doceumentsOnline): bool
|
public function delete(User $user, DocumentsOnline $doceumentsOnline): bool
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ class OnlineDocumentsPolicy
|
||||||
/**
|
/**
|
||||||
* Determine whether the user can restore the model.
|
* Determine whether the user can restore the model.
|
||||||
*/
|
*/
|
||||||
public function restore(User $user, OnlineDocuments $doceumentsOnline): bool
|
public function restore(User $user, DocumentsOnline $doceumentsOnline): bool
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class OnlineDocumentsPolicy
|
||||||
/**
|
/**
|
||||||
* Determine whether the user can permanently delete the model.
|
* Determine whether the user can permanently delete the model.
|
||||||
*/
|
*/
|
||||||
public function forceDelete(User $user, OnlineDocuments $doceumentsOnline): bool
|
public function forceDelete(User $user, DocumentsOnline $doceumentsOnline): bool
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@ namespace Database\Factories;
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\OnlineDocuments>
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DocumentsOnline>
|
||||||
*/
|
*/
|
||||||
class DocumentsOnlineFactory extends Factory
|
class DocumentsOnlineFactory extends Factory
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ return new class extends Migration
|
||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('online_documents', function (Blueprint $table) {
|
Schema::create('documents_online', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('url');
|
$table->string('url');
|
||||||
|
@ -26,6 +26,6 @@ return new class extends Migration
|
||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('online_documents');
|
Schema::dropIfExists('documents_online');
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -20,8 +20,8 @@ class DatabaseSeeder extends Seeder
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
'password' => 123456
|
'password' => 123456
|
||||||
]);
|
]);
|
||||||
$this->call([
|
// $this->call([
|
||||||
OnlineDocumentsSeeder::class
|
// DocumentsOnlineSeeder::class
|
||||||
]);
|
// ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@ use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class OnlineDocumentsSeeder extends Seeder
|
class DocumentsOnlineSeeder extends Seeder
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the database seeds.
|
* Run the database seeds.
|
||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
DB::table('online_documents')->insert([
|
DB::table('documents_online')->insert([
|
||||||
[
|
[
|
||||||
'name' => 'Подать документы онлайн',
|
'name' => 'Подать документы онлайн',
|
||||||
'url' => '',
|
'url' => '',
|
|
@ -0,0 +1,8 @@
|
||||||
|
@extends('layouts.admin-layout')
|
||||||
|
@section('content')
|
||||||
|
@foreach($documentsOnline as $documentOnline)
|
||||||
|
{{ $documentOnline->name }}
|
||||||
|
{{ $documentOnline->url }}
|
||||||
|
{{ $documentOnline->description }}
|
||||||
|
@endforeach
|
||||||
|
@endsection
|
|
@ -6,8 +6,7 @@
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
<meta name="csrf-param" content="_token"/>
|
<meta name="csrf-param" content="_token"/>
|
||||||
|
|
||||||
<title>Панель администратора</title>
|
<title>{{ __('layout.title') }}</title>
|
||||||
@vite(['resources/js/app.js'])
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://getbootstrap.su/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
<link href="https://getbootstrap.su/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
@ -17,12 +16,12 @@
|
||||||
<header
|
<header
|
||||||
class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-4 border-bottom">
|
class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-4 border-bottom">
|
||||||
<ul class="nav col-9 col-md-auto mb-2 justify-content-start mb-md-0">
|
<ul class="nav col-9 col-md-auto mb-2 justify-content-start mb-md-0">
|
||||||
<li><a href="{{ route('dashboard') }}" class="nav-link px-2 link-secondary text-wrap" style="width: 4rem;">Главная</a></li>
|
<li><a href="#" class="nav-link px-2 link-secondary text-wrap" style="width: 4rem;">Главная</a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="col-md-3 text-center">
|
<div class="col-md-3 text-center">
|
||||||
<a href="{{ route('home') }}" class="nav-link px-2 link-secondary">Сайт abitur.mkgtu.ru</a>
|
<a href="#" class="nav-link px-2 link-secondary">Сайт abitur.mkgtu.ru</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 text-end">
|
<div class="col-md-3 text-end">
|
||||||
|
@ -46,28 +45,21 @@
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="row align-items-start">
|
<aside>
|
||||||
<aside class="list-group col-2">
|
<ul class="list-group col-2">
|
||||||
<ul>
|
<li class="list-group-item">
|
||||||
<li class="list-group-item">
|
<a href="{{ route('documents-online.index') }}">Подать Документы онлайн</a>
|
||||||
<a href="{{ route('online-documents.index') }}">Подать Документы онлайн</a>
|
</li>
|
||||||
</li>
|
<li class="list-group-item"><a href="">Абитуриенту</a></li>
|
||||||
<li class="list-group-item"><a href="">Абитуриенту</a></li>
|
<li class="list-group-item"><a href="">Экран Приема</a></li>
|
||||||
<li class="list-group-item"><a href="">Экран Приема</a></li>
|
<li class="list-group-item"><a href="">Иностранным абитурентам</a></li>
|
||||||
<li class="list-group-item"><a href="">Иностранным абитурентам</a></li>
|
<li class="list-group-item"><a href="">Дни открытых дверей</a></li>
|
||||||
<li class="list-group-item"><a href="">Дни открытых дверей</a></li>
|
<li class="list-group-item"><a href="">Стоимость обучения</a></li>
|
||||||
<li class="list-group-item"><a href="">Стоимость обучения</a></li>
|
<li class="list-group-item"><a href="">Олимпиады для школьников</a></li>
|
||||||
<li class="list-group-item"><a href="">Олимпиады для школьников</a></li>
|
<li class="list-group-item"><a href="">Подготовительные курсы</a></li>
|
||||||
<li class="list-group-item"><a href="">Подготовительные курсы</a></li>
|
</ul>
|
||||||
@if(Auth::getUser()->name === 'admin')
|
</aside>
|
||||||
<li class="list-group-item"></li>
|
@yield('content')
|
||||||
<li class="list-group-item"><a href="{{ route('users.index') }}">Список администраторов</a></li>
|
|
||||||
@endif
|
|
||||||
</ul>
|
|
||||||
</aside>
|
|
||||||
<div class="col-10">@yield('content')</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/sass/app.scss', 'resources/js/app.js'])
|
||||||
</head>
|
</head>
|
||||||
<body class="font-sans antialiased">
|
<body class="font-sans antialiased">
|
||||||
<div class="min-h-screen bg-gray-100 dark:bg-gray-900">
|
<div class="min-h-screen bg-gray-100 dark:bg-gray-900">
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/sass/app.scss', 'resources/js/app.js'])
|
||||||
</head>
|
</head>
|
||||||
<body class="font-sans text-gray-900 antialiased" >
|
<body class="font-sans text-gray-900 antialiased" >
|
||||||
<div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100 dark:bg-gray-900" style="background-color:#006147">
|
<div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100 dark:bg-gray-900" style="background-color:#006147">
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
@extends('layouts.admin-layout')
|
|
||||||
@section('content')
|
|
||||||
@foreach($onlineDocuments as $onlineDocument)
|
|
||||||
<div>
|
|
||||||
{{ $onlineDocument->name }}
|
|
||||||
{{ $onlineDocument->url }}
|
|
||||||
{{ $onlineDocument->parent }}
|
|
||||||
{{ $onlineDocument->children }}
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
@endsection
|
|
|
@ -1,17 +1,15 @@
|
||||||
@extends('layouts.admin-layout')
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
@auth()
|
@auth()
|
||||||
<div class="">
|
<div class="grid col-span-full">
|
||||||
<h1 class=""> Создать администратора</h1>
|
<h1 class="max-w-2xl mb-4 text-4xl leading-none tracking-tight md:text-5xl xl:text-6xl dark:text-white"> создать
|
||||||
|
пользователя</h1>
|
||||||
|
|
||||||
{{ Form::open(['url' => route('users.store'), 'method' => 'POST', 'class' => '']) }}
|
{{ Form::open(['url' => route('users.store'), 'method' => 'POST', 'class' => 'w-50']) }}
|
||||||
<div class="col-4">
|
<div class="flex flex-col">
|
||||||
<div>
|
<div>
|
||||||
{{ Form::label('name', 'Логин') }}
|
{{ Form::label('name', 'Логин') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{ Form::text('name', '', ['class' => 'form-control']) }}
|
{{ Form::text('name', '', ['class' => 'form-control rounded border-gray-300 w-1/3']) }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
@ -23,7 +21,7 @@
|
||||||
{{ Form::label('email', 'электронная почта') }}
|
{{ Form::label('email', 'электронная почта') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{ Form::text('email', '', ['class' => 'form-control']) }}
|
{{ Form::text('email', '', ['class' => 'form-control rounded border-gray-300 w-1/3']) }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
@ -35,7 +33,7 @@
|
||||||
{{ Form::label('password', 'Пароль') }}
|
{{ Form::label('password', 'Пароль') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{ Form::text('password', '', ['class' => 'form-control']) }}
|
{{ Form::text('password', '', ['class' => 'form-control rounded border-gray-300 w-1/3']) }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
@ -44,10 +42,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
{{ Form::submit('создать', ['class' => 'btn btn-primary']) }}
|
{{ Form::submit('создать', ['class' => 'bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded']) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ Form::close() }}
|
{{ Form::close() }}
|
||||||
</div>
|
</div>
|
||||||
@endauth
|
@endauth
|
||||||
@endsection
|
|
||||||
|
|
|
@ -1,18 +1,15 @@
|
||||||
@extends('layouts.admin-layout')
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
@auth()
|
@auth()
|
||||||
<div>
|
<div class="grid col-span-full">
|
||||||
<h1 class=""> Изменить Администратора</h1>
|
<h1 class="max-w-2xl mb-4 text-4xl leading-none tracking-tight md:text-5xl xl:text-6xl dark:text-white"> Изменить
|
||||||
<br>
|
пользователя</h1>
|
||||||
<br>
|
|
||||||
{{ Form::open(['url' => route('users.update', $user), 'method' => 'PATCH', 'class' => '']) }}
|
{{ Form::open(['url' => route('users.update', $user), 'method' => 'PATCH', 'class' => 'w-50']) }}
|
||||||
<div class="col-4">
|
<div class="flex flex-col">
|
||||||
<div>
|
<div>
|
||||||
{{ Form::label('name', 'Логин') }}
|
{{ Form::label('name', 'Логин') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{ Form::text('name', $user->name, ['class' => 'form-control']) }}
|
{{ Form::text('name', $user->name, ['class' => 'form-control rounded border-gray-300 w-1/3']) }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
@ -24,7 +21,7 @@
|
||||||
{{ Form::label('email', 'электронная почта') }}
|
{{ Form::label('email', 'электронная почта') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{ Form::text('email', $user->email, ['class' => 'form-control']) }}
|
{{ Form::text('email', $user->email, ['class' => 'form-control rounded border-gray-300 w-1/3']) }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
@ -36,7 +33,7 @@
|
||||||
{{ Form::label('password', 'Пароль') }}
|
{{ Form::label('password', 'Пароль') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{ Form::text('password', '', ['class' => 'form-control']) }}
|
{{ Form::text('password', '', ['class' => 'form-control rounded border-gray-300 w-1/3']) }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if ($errors->any())
|
@if ($errors->any())
|
||||||
|
@ -45,10 +42,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
{{ Form::submit('изменить', ['class' => 'btn btn-primary']) }}
|
{{ Form::submit('изменить', ['class' => 'bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded']) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ Form::close() }}
|
{{ Form::close() }}
|
||||||
</div>
|
</div>
|
||||||
@endauth
|
@endauth
|
||||||
@endsection
|
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
@extends('layouts.admin-layout')
|
@extends('layouts.admin-layout')
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>список Администраторов</h2>
|
<h2>список пользователей</h2>
|
||||||
<br>
|
|
||||||
<a href="{{ route('users.create') }}" class="btn btn-primary">Создать администратора</a>
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<table class="table">
|
<a href="{{ route('users.create') }}"> создать пользователя</a>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<table class="mt-4">
|
||||||
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
|
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">id</th>
|
<th>id</th>
|
||||||
<th scope="col">name</th>
|
<td>name</td>
|
||||||
<th scope="col">email</th>
|
<td>email</td>
|
||||||
<th scope="col">действия</th>
|
<td>действия</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($users as $user)
|
@foreach($users as $user)
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ $user->id }}</th>
|
<td>{{ $user->id }}</td>
|
||||||
<td>{{ $user->name }}</td>
|
<td>{{ $user->name }}</td>
|
||||||
<td>{{ $user->email }}</td>
|
<td>{{ $user->email }}</td>
|
||||||
<td><a href="{{ route("users.edit", $user) }}" class="btn btn-secondary">редактировать</a>
|
<td><a href="{{ route("users.edit", $user) }}">редактировать</a></td>
|
||||||
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
|
<td><a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
|
||||||
href="{{ route('users.destroy', $user) }}" class="btn btn-danger">
|
href="{{ route('users.destroy', $user) }}">
|
||||||
удалить
|
удалить
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Http\Controllers\OnlineDocumentsController;
|
use App\Http\Controllers\DocumentsOnlineController;
|
||||||
use App\Http\Controllers\ProfileController;
|
use App\Http\Controllers\ProfileController;
|
||||||
use App\Http\Controllers\UploadFileController;
|
use App\Http\Controllers\UploadFileController;
|
||||||
use App\Http\Controllers\UserController;
|
use App\Http\Controllers\UserController;
|
||||||
|
@ -23,7 +23,7 @@ Route::get('/', function () {
|
||||||
|
|
||||||
Route::resources([
|
Route::resources([
|
||||||
'/users' => UserController::class,
|
'/users' => UserController::class,
|
||||||
'/online-documents' => OnlineDocumentsController::class
|
'/documents-online' => DocumentsOnlineController::class
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Route::get('/course', function () {
|
Route::get('/course', function () {
|
||||||
|
|
Loading…
Reference in New Issue