Compare commits

...

2 Commits

Author SHA1 Message Date
aslan b8063db38b Merge remote-tracking branch 'origin/main'
Tests & Lint & Deploy to Railway / build (20.x, 8.2) (push) Failing after 1m58s Details
Tests & Lint & Deploy to Railway / deploy (8.1) (push) Has been skipped Details
2024-01-23 11:20:22 +03:00
aslan ef1309b2e3 add ReceptionScreen web resource 2024-01-23 11:20:15 +03:00
16 changed files with 176 additions and 134 deletions

View File

@ -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)
{
//
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreReceptionScreenRequest;
use App\Http\Requests\UpdateReceptionScreenRequest;
use App\Models\ReceptionScreen;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Auth;
class ReceptionScreenController extends Controller
{
public function index(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
{
$onlineDocuments = ReceptionScreen::all();
return view('admin-reception-screen.index', compact('onlineDocuments'));
}
public function create(ReceptionScreen $documentOnline): View
{
if (Auth::guest()) {
abort(403);
}
$parent = $documentOnline;
return view('admin-reception-screen', compact('parent'));
}
public function store(StoreReceptionScreenRequest $request)
{
}
/**
* Display the specified resource.
*/
public function show(ReceptionScreen $doceumentsOnline)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(ReceptionScreen $doceumentsOnline)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateReceptionScreenRequest $request, ReceptionScreen $doceumentsOnline)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(ReceptionScreen $doceumentsOnline)
{
//
}
}

View File

@ -4,7 +4,7 @@ namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreOnlineDocumentsRequest extends FormRequest
class StoreReceptionScreenRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.

View File

@ -4,7 +4,7 @@ namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateOnlineDocumentsRequest extends FormRequest
class UpdateReceptionScreenRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.

View File

@ -5,7 +5,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class OnlineDocuments extends Model
class ReceptionScreen extends Model
{
use HasFactory;

View File

@ -2,11 +2,11 @@
namespace App\Policies;
use App\Models\OnlineDocuments;
use App\Models\ReceptionScreen;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class OnlineDocumentsPolicy
class ReceptionScreenPolicy
{
/**
* Determine whether the user can view any models.
@ -19,7 +19,7 @@ class OnlineDocumentsPolicy
/**
* Determine whether the user can view the model.
*/
public function view(User $user, OnlineDocuments $doceumentsOnline): bool
public function view(User $user, ReceptionScreen $doceumentsOnline): bool
{
//
}
@ -35,7 +35,7 @@ class OnlineDocumentsPolicy
/**
* Determine whether the user can update the model.
*/
public function update(User $user, OnlineDocuments $doceumentsOnline): bool
public function update(User $user, ReceptionScreen $doceumentsOnline): bool
{
//
}
@ -43,7 +43,7 @@ class OnlineDocumentsPolicy
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, OnlineDocuments $doceumentsOnline): bool
public function delete(User $user, ReceptionScreen $doceumentsOnline): bool
{
//
}
@ -51,7 +51,7 @@ class OnlineDocumentsPolicy
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, OnlineDocuments $doceumentsOnline): bool
public function restore(User $user, ReceptionScreen $doceumentsOnline): bool
{
//
}
@ -59,7 +59,7 @@ class OnlineDocumentsPolicy
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, OnlineDocuments $doceumentsOnline): bool
public function forceDelete(User $user, ReceptionScreen $doceumentsOnline): bool
{
//
}

View File

@ -5,9 +5,9 @@ namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\OnlineDocuments>
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ReceptionScreen>
*/
class DocumentsOnlineFactory extends Factory
class ReceptionScreenFactory extends Factory
{
/**
* Define the model's default state.

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('reception_screens', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('reception_screens');
}
};

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('submenu', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('description');
$table->string('parent');
$table->string('meta_title');
$table->string('meta_description');
$table->string('meta_keywords');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('submenu');
}
};

View File

@ -11,12 +11,10 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('online_documents', function (Blueprint $table) {
Schema::create('file', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('url');
$table->string('parent');
$table->string('children');
$table->timestamps();
});
}
@ -26,6 +24,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('online_documents');
Schema::dropIfExists('file');
}
};

View File

@ -21,7 +21,7 @@ class DatabaseSeeder extends Seeder
'password' => 123456
]);
$this->call([
OnlineDocumentsSeeder::class
ReceptionScreenSeeder::class
]);
}
}

View File

@ -1,41 +0,0 @@
<?php
namespace Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class OnlineDocumentsSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('online_documents')->insert([
[
'name' => 'Подать документы онлайн',
'url' => '',
'parent' => '0',
'children' => '2/3',
'created_at' => Carbon::now(),
],
[
'name' => 'По образовательным программам высшего образования',
'url' => '',
'parent' => '1',
'children' => '',
'created_at' => Carbon::now(),
],
[
'name' => 'По образовательным программам среднего профессионального образования (колледж)',
'url' => '',
'parent' => '1',
'children' => '',
'created_at' => Carbon::now(),
]
]);
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class ReceptionScreenSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('reception_screens')->insert([
[
'name' => 'Пункт 1 с файлами',
'created_at' => Carbon::now(),
],
[
'name' => 'Пункт 2 с файлами',
'created_at' => Carbon::now(),
],
[
'name' => 'Пункт 3 с файлами',
'created_at' => Carbon::now(),
]
]);
}
}

View File

@ -49,16 +49,8 @@
<div class="row align-items-start">
<aside class="list-group col-2">
<ul>
<li class="list-group-item">
<a href="{{ route('online-documents.index') }}">Подать Документы онлайн</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="{{ route('admin-reception-screen.index') }}">Экран Приема</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>
@if(Auth::getUser()->name === 'admin')
<li class="list-group-item"></li>
<li class="list-group-item"><a href="{{ route('users.index') }}">Список администраторов</a></li>

View File

@ -1,6 +1,6 @@
<?php
use App\Http\Controllers\OnlineDocumentsController;
use App\Http\Controllers\ReceptionScreenController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\UploadFileController;
use App\Http\Controllers\UserController;
@ -23,7 +23,7 @@ Route::get('/', function () {
Route::resources([
'/users' => UserController::class,
'/online-documents' => OnlineDocumentsController::class
'/admin-reception-screen' => ReceptionScreenController::class
]);
Route::get('/course', function () {