Compare commits

...

14 Commits

Author SHA1 Message Date
aslan 90d38a74ad Merge pull request 'screen changes' (#60) from RomanGolienko/Roman_applicant-site:feature/visually-impaired-mode into main
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Failing after 9s Details
Tests & Lint & Deploy to Railway / deploy (push) Has been skipped Details
Reviewed-on: aslan/applicant-site#60
2024-07-25 14:24:26 +03:00
aslan 4b5b29f8b9 composer update
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Successful in 3m21s Details
Tests & Lint & Deploy to Railway / deploy (push) Successful in 55s Details
2024-06-18 16:23:18 +03:00
aslan aaaec23a25 Merge remote-tracking branch 'origin/main'
Tests & Lint & Deploy to Railway / deploy (push) Blocked by required conditions Details
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Has been cancelled Details
2024-06-18 16:23:05 +03:00
aslan b65cce5722 add direction Description 2024-06-18 16:22:54 +03:00
aslan b9dfe9669a Merge pull request 'calculator fix' (#59) from RomanGolienko/Roman_applicant-site:feature/visually-impaired-mode into main
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Failing after 12m21s Details
Tests & Lint & Deploy to Railway / deploy (push) Has been skipped Details
Reviewed-on: aslan/applicant-site#59
2024-06-13 15:44:05 +03:00
aslan d6b07066de Merge pull request 'feature/visually-impaired-mode' (#58) from RomanGolienko/Roman_applicant-site:feature/visually-impaired-mode into main
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Failing after 13m43s Details
Tests & Lint & Deploy to Railway / deploy (push) Has been skipped Details
Reviewed-on: aslan/applicant-site#58
2024-06-13 13:55:16 +03:00
aslan 7206bab9c2 fix test update news with picture
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Successful in 2m35s Details
Tests & Lint & Deploy to Railway / deploy (push) Successful in 32s Details
2024-06-11 10:39:24 +03:00
aslan 18df25c6a8 fix edit picture news 2024-06-11 10:37:39 +03:00
aslan 9f926f4ac5 fix message validation
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Successful in 2m40s Details
Tests & Lint & Deploy to Railway / deploy (push) Successful in 30s Details
2024-06-11 10:19:04 +03:00
aslan 73e6502e60 fix last position and last admission id 2024-06-11 10:18:49 +03:00
aslan 97f4cd68e6 fix unique name document 2024-06-11 10:18:02 +03:00
aslan 0419aebe18 Merge remote-tracking branch 'origin/main'
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Successful in 3m22s Details
Tests & Lint & Deploy to Railway / deploy (push) Successful in 35s Details
2024-06-11 09:41:24 +03:00
aslan 4093e2ce51 fix nullable description 2024-06-11 09:41:13 +03:00
aslan 90fffa0279 Merge pull request 'gitignore fix' (#57) from RomanGolienko/Roman_applicant-site:feature/visually-impaired-mode into main
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Failing after 0s Details
Tests & Lint & Deploy to Railway / deploy (push) Has been skipped Details
Reviewed-on: aslan/applicant-site#57
2024-06-06 16:39:57 +03:00
24 changed files with 880 additions and 902 deletions

View File

@ -3,7 +3,9 @@
namespace App\Helpers;
use App\Models\Direction;
use App\Models\DirectionDescription;
use App\Models\DirectionProfile;
use App\Models\Document;
use App\Models\EntranceExamination;
use App\Models\ExaminationType;
use App\Models\Faculty;
@ -66,4 +68,16 @@ class PositionHelper
$maxPosition = EntranceExamination::max('position');
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
}
public static function document()
{
$maxPosition = Document::max('position');
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
}
public static function directionDescription()
{
$maxPosition = DirectionDescription::max('position');
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
}
}

View File

@ -46,9 +46,11 @@ class NewsController extends Controller
public function update(UpdateNewsRequest $request, News $news)
{
$validated = $request->validated();
$urlPhoto = Storage::put('public', $request->file('photo'));
$news->name = $validated['name'];
$news->text = $validated['text'];
$news->photo = Storage::url($urlPhoto);
$news->save();
return redirect()->route('news.index');
}

View File

@ -0,0 +1,72 @@
<?php
namespace App\Http\Controllers\admin\Catalog;
use App\Http\Controllers\Controller;
use App\Http\Requests\admin\StoreDirectionDescriptionRequest;
use App\Http\Requests\admin\UpdateDirectionDescriptionRequest;
use App\Models\Direction;
use App\Models\DirectionDescription;
use Illuminate\Support\Facades\Storage;
class DirectionDescriptionController extends Controller
{
public function index()
{
$directionDescriptions = DirectionDescription::all();
return view('admin.catalog.direction_description.index', compact('directionDescriptions'));
}
public function create()
{
$directionCodes = Direction::pluck('full_name', 'code');
return view('admin.catalog.direction_description.create', compact('directionCodes'));
}
public function store(StoreDirectionDescriptionRequest $request)
{
$validated = $request->validated();
$fileName = $request->file('file')->getClientOriginalName();
$name = Storage::put('public', $request->file('file'));
$directionDescription = new DirectionDescription();
$directionDescription->url = Storage::url($name);
$directionDescription->direction_code = Direction::select('code', 'id')
->where('code', $validated['direction_code'])
->first()
->id;
$directionDescription->file_name = $fileName;
$directionDescription->position = $validated['position'];
$directionDescription->save();
return redirect()->route('direction_descriptions.index');
}
public function edit(DirectionDescription $directionDescription)
{
$directionCodes = Direction::pluck('full_name', 'code');
return view('admin.catalog.direction_description.edit', compact('directionDescription', 'directionCodes'));
}
public function update(UpdateDirectionDescriptionRequest $request, DirectionDescription $directionDescription)
{
$validated = $request->validated();
$fileName = $request->file('file')->getClientOriginalName();
$name = Storage::put('public', $request->file('file'));
$directionDescription->url = Storage::url($name);
$directionDescription->direction_code = Direction::select('code', 'id')
->where('code', $validated['direction_code'])
->first()
->id;
$directionDescription->file_name = $fileName;
$directionDescription->position = $validated['position'];
$directionDescription->save();
return redirect()->route('direction_descriptions.index');
}
public function destroy(DirectionDescription $directionDescription)
{
$directionDescription->delete();
return redirect()->route('direction_descriptions.index');
}
}

View File

@ -24,7 +24,9 @@ class DocumentController extends Controller
public function create(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
{
$admissions = Admission::pluck('name', 'id');
return view('admin.documents.create', compact('admissions'));
$lastDocument = Document::latest()->first();
// dd($lastDocument->admission_id);
return view('admin.documents.create', compact('admissions', 'lastDocument'));
}
public function store(StoreDocumentRequest $request): RedirectResponse

View File

@ -0,0 +1,23 @@
<?php
namespace App\Http\Requests\admin;
use Illuminate\Foundation\Http\FormRequest;
class StoreDirectionDescriptionRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'direction_code' => 'required|string|max:255|exists:directions,code',
'file' => 'required|file',
'file_name' => 'nullable|string|max:255',
'position' => 'required|int|numeric|max:255',
];
}
}

View File

@ -16,10 +16,30 @@ class StoreDocumentRequest extends FormRequest
{
return [
'name' => 'required|string|max:255',
'description' => 'string',
'description' => 'string|nullable',
'position' => 'required|int|numeric|max:255',
'document' => 'required|file',
'admission_id' => 'required|int|numeric|max:1000',
];
}
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'document.required' => 'Поле документ обязательно.',
'admission_id.required' => 'Поле Пункт приема обучения обязательно.',
'admission_id.int' => 'Стоимость Пункт приема должно быть целым числом.',
'admission_id.numeric' => 'Стоимость Пункт приема должно быть числом.',
'admission_id.max' => 'Стоимость Пункт приема не должен быть больше :max',
];
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Http\Requests\admin;
use Illuminate\Foundation\Http\FormRequest;
class UpdateDirectionDescriptionRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'direction_code' => 'required|string|max:255|exists:directions,code',
'file' => 'required|file',
'file_name' => 'nullable|string|max:255',
'position' => 'required|int|numeric|max:255',
];
}
}

View File

@ -21,8 +21,28 @@ class UpdateDocumentRequest extends FormRequest
"unique:documents,name,{$this->document->id}",
],
'position' => 'required|int|numeric|max:255',
'description' => 'string',
'description' => 'string|nullable',
'admission_id' => 'required|int|numeric|max:1000',
];
}
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'document.required' => 'Поле документ обязательно.',
'admission_id.required' => 'Поле Пункт приема обучения обязательно.',
'admission_id.int' => 'Стоимость Пункт приема должно быть целым числом.',
'admission_id.numeric' => 'Стоимость Пункт приема должно быть числом.',
'admission_id.max' => 'Стоимость Пункт приема не должен быть больше :max',
];
}
}

View File

@ -16,6 +16,7 @@ class UpdateNewsRequest extends FormRequest
return [
'name' => 'required|string|max:255',
'text' => 'string',
'photo' => 'required|file',
];
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DirectionDescription extends Model
{
use HasFactory;
protected $fillable = [
'direction_code',
'file_name',
'position',
'url'
];
}

View File

@ -13,29 +13,29 @@
"fakerphp/faker": "^1.23.1",
"guzzlehttp/guzzle": "^7.8.1",
"imangazaliev/didom": "^2.0.1",
"laracasts/flash": "^3.2",
"laravel/framework": "^10.48.2",
"laracasts/flash": "^3.2.3",
"laravel/framework": "^10.48.12",
"laravel/sanctum": "^3.3.3",
"laravel/tinker": "^2.9.0",
"laravel/ui": "^4.5.0",
"laravel/ui": "^4.5.2",
"laravelcollective/html": "^6.4.1",
"league/flysystem": "^3.25.0",
"league/flysystem": "^3.28.0",
"maatwebsite/excel": "^3.1.55",
"rap2hpoutre/laravel-log-viewer": "^2.3",
"spatie/laravel-query-builder": "^5.8",
"rap2hpoutre/laravel-log-viewer": "^2.4.0",
"spatie/laravel-query-builder": "^5.8.1",
"twbs/bootstrap": "5.2.3"
},
"require-dev": {
"laravel/breeze": "^1.29.1",
"laravel/pint": "^1.14.0",
"laravel/sail": "^1.29.0",
"mockery/mockery": "^1.6.9",
"laravel/pint": "^1.16.0",
"laravel/sail": "^1.29.2",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^7.10.0",
"phpunit/phpunit": "^10.5.13",
"spatie/laravel-ignition": "^2.4.2",
"phpunit/phpunit": "^10.5.21",
"spatie/laravel-ignition": "^2.8.0",
"barryvdh/laravel-ide-helper": "^2.15.1",
"squizlabs/php_codesniffer": "^3.9.0",
"phpstan/phpstan": "^1.10.62"
"squizlabs/php_codesniffer": "^3.10.1",
"phpstan/phpstan": "^1.11.5"
},
"autoload": {
"psr-4": {

1273
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DirectionDescription>
*/
class DirectionDescriptionFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'file_name' => fake()->name(),
'position' => 1,
'url' => fake()->url(),
];
}
}

View File

@ -10,7 +10,7 @@ return new class extends Migration
{
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->string('name', 255)->unique();
$table->string('name', 255);
$table->string('file_name')->nullable();
$table->text('description')->nullable();
$table->string('url', 255);

View File

@ -0,0 +1,31 @@
<?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('direction_descriptions', function (Blueprint $table) {
$table->id();
$table->foreignId('direction_code')->constrained('directions');
$table->string('file_name', 255)->nullable();
$table->string('position', 255);
$table->string('url', 255);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('direction_descriptions');
}
};

View File

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DirectionDescriptionSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@ -0,0 +1,72 @@
@php use App\Helpers\PositionHelper; @endphp
@extends('layouts.admin_layout')
@section('content')
@auth()
<div class="row">
<div class="col">
<h1 class="">Прикрепить файл</h1>
{{ Form::open(['url' => route('direction_descriptions.store'), 'method' => 'POST', 'files'=>'true', 'class' => 'needs-validation', 'novalidate']) }}
<div class="mt-3">
{{ Form::label('direction_code', 'Направление', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::select('direction_code', $directionCodes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
<div class="invalid-feedback">
Поле "Направление" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('direction_code') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('file', 'Путь к Файлу', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::file('file', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
<div class="invalid-feedback">
Поле "Путь к документу" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('file') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('file_name', 'Имя файла') }}
</div>
<div class="mt-1">
{{ Form::text('file_name', '', ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('name') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('position', 'Позиция') }}
</div>
<div class="mt-1">
{{ Form::text('position', PositionHelper::directionDescription(), ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('position') }}
@endif
</div>
<div class="mt-4">
{{ Form::submit('Загрузить файл', ['class' => 'btn btn-primary'])}}
</div>
{{Form::close()}}
</div>
</div>
@endauth
@endsection

View File

@ -0,0 +1,71 @@
@extends('layouts.admin_layout')
@section('content')
@auth()
<div class="row">
<div class="col">
<h1 class="">Заменить файл</h1>
{{ Form::open(['url' => route('direction_descriptions.update', $directionDescription), 'method' => 'PATCH', 'files'=>'true', 'class' => 'needs-validation', 'novalidate']) }}
<div class="mt-3">
{{ Form::label('direction_code', 'Направление', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::select('direction_code', $directionCodes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
<div class="invalid-feedback">
Поле "Направление" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('direction_code') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('file', 'Путь к Файлу', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::file('file', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
<div class="invalid-feedback">
Поле "Путь к документу" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('file') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('file_name', 'Имя файла') }}
</div>
<div class="mt-1">
{{ Form::text('file_name', $directionDescription->file_name, ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('name') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('position', 'Позиция') }}
</div>
<div class="mt-1">
{{ Form::text('position', $directionDescription->position, ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('position') }}
@endif
</div>
<div class="mt-4">
{{ Form::submit('Загрузить файл', ['class' => 'btn btn-primary'])}}
</div>
{{Form::close()}}
</div>
</div>
@endauth
@endsection

View File

@ -0,0 +1,35 @@
@php use App\Models\Direction; @endphp
@extends('layouts.admin_layout')
@section('content')
<div class="container">
<h2>Документы</h2>
<br>
<a href="{{ route('direction_descriptions.create') }}" class="btn btn-primary">Добавить документ</a>
<br>
<br>
<table class="table">
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
<tr>
<th scope="col">Направление</th>
<th scope="col">файл</th>
<th scope="col">действия</th>
</tr>
</thead>
<tbody>
@foreach($directionDescriptions as $directionDescription)
<tr>
<td>{{ Str::limit(Direction::where('id', $directionDescription->direction_code)->first()->full_name, 50) }}</td>
<td>{{ $directionDescription->file_name }}</td>
<td><a href="{{ route("direction_descriptions.edit", $directionDescription) }}" class="btn btn-secondary">редактировать</a>
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
href="{{ route('direction_descriptions.destroy', $directionDescription) }}" class="btn btn-danger">
удалить
</a>
</td>
@endforeach
</tbody>
</table>
<br>
<br>
</div>
@endsection

View File

@ -1,3 +1,4 @@
@php use App\Helpers\PositionHelper; @endphp
@extends('layouts.admin_layout')
@section('content')
@auth()
@ -42,7 +43,7 @@
{{ Form::label('position', 'Позиция') }}
</div>
<div class="mt-2">
{{ Form::text('position', 0, ['class' => 'form-control']) }}
{{ Form::text('position', PositionHelper::document(), ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
@ -53,7 +54,7 @@
{{ Form::label('admission_id', 'Пункт экрана приема') }}
</div>
<div class="mt-2">
{{ Form::select('admission_id', $admissions, null, ['class' => 'form-select']) }}
{{ Form::select('admission_id', $admissions, $lastDocument->admission_id, ['class' => 'form-select']) }}
</div>
<div>
@if ($errors->any())

View File

@ -40,6 +40,22 @@
@endif
</div>
<div class="mt-2">
{{ Form::label('photo', 'Путь к фото') }}
<span class="text-danger">*</span>
</div>
<div class="mt-2">
{{ Form::file('photo', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.news.photo'), 'required']) }}
<div class="invalid-feedback">
Поле "Путь к фото" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('photo') }}
@endif
</div>
<div class="mt-3">
{{ Form::submit('Изменить', ['class' => 'btn btn-primary']) }}
</div>

View File

@ -56,7 +56,9 @@
<li class="list-group-item {{ request()->is('admin/feedback*') && !request()->is('admin/feedback_statuses*') ? 'active' : '' }}"><a class="{{ request()->is('admin/feedback*') && !request()->is('admin/feedback_statuses*') ? 'link-light' : '' }}" href="{{ route('feedback.index') }}">Обратная связь</a></li>
<li class="list-group-item {{ request()->is('admin/documents*') ? 'active' : '' }}"><a class="{{ request()->is('admin/documents*') ? 'link-light' : '' }}" href="{{ route('documents.index') }}">Документы</a></li>
<li class="list-group-item {{ request()->is('admin/admissions*') ? 'active' : '' }}"><a class="{{ request()->is('admin/admissions*') ? 'link-light' : '' }}" href="{{ route('admissions.index') }}">Экран Приема</a></li>
<li class="list-group-item"></li>
<li class="list-group-item {{ request()->is('admin/directions*') ? 'active' : '' }}"><a class="{{ request()->is('admin/directions*') ? 'link-light' : '' }}" href="{{ route('directions.index') }}">Направления</a></li>
<li class="list-group-item {{ request()->is('admin/direction_descriptions*') ? 'active' : '' }}"><a class="{{ request()->is('admin/direction_descriptions*') ? 'link-light' : '' }}" href="{{ route('direction_descriptions.index') }}">Файлы для Направлений</a></li>
@can('viewAny', Auth::user())
<li class="list-group-item"></li>
<li class="list-group-item {{ request()->is('admin/users*') ? 'active' : '' }}"><a class="{{ request()->is('admin/users*') ? 'link-light' : '' }}" href="{{ route('users.index') }}">Список администраторов</a></li>

View File

@ -10,6 +10,7 @@ use App\Http\Controllers\admin\Catalog\Direction\ExaminationTypeController;
use App\Http\Controllers\admin\Catalog\Direction\SubjectController;
use App\Http\Controllers\admin\Catalog\Direction\SubjectTypeController;
use App\Http\Controllers\admin\Catalog\DirectionController;
use App\Http\Controllers\admin\Catalog\DirectionDescriptionController;
use App\Http\Controllers\admin\Catalog\EducationalInstitutionController;
use App\Http\Controllers\admin\Catalog\FacultyController;
use App\Http\Controllers\admin\DocumentController;
@ -69,6 +70,8 @@ Route::middleware(['auth', 'verified'])->prefix('admin')->group(function () {
Route::resource('/direction_profiles', DirectionProfileController::class)
->scoped(['direction_profile' => 'slug']);
Route::resource('/direction_descriptions', DirectionDescriptionController::class)
->scoped(['direction_descriptions' => 'slug']);
Route::resource('/feedback', FeedbackController::class)->only(['index', 'edit', 'update']);
Route::resource('/feedback_statuses', FeedbackStatusController::class);

View File

@ -79,9 +79,10 @@ class NewsTest extends TestCase
public function testUpdateNews(): void
{
$file = UploadedFile::fake()->create('fake.jpg', 100);
$response = $this->actingAs($this->user)
->withSession(['banned' => false])
->patch(route('news.update', $this->news), $this->data);
->patch(route('news.update', $this->news), [...$this->data, 'photo' => $file]);
$response->assertRedirect(route('news.index'));