Compare commits
65 Commits
feature/ta
...
master
Author | SHA1 | Date | |
---|---|---|---|
d157d40747 | |||
ac5d318cef | |||
|
c6676bd6d1 | ||
|
780a12581f | ||
|
733bb76122 | ||
|
c7fefd138a | ||
|
321ce81ff0 | ||
ecec8b176c | |||
|
769760f414 | ||
|
d4cabb23b7 | ||
|
b088c3d624 | ||
2e3d757a53 | |||
|
6fb18f6949 | ||
|
36cb0c700a | ||
|
5395261084 | ||
|
bcdec4dcc7 | ||
|
1216f6b81b | ||
bd0aca1ff5 | |||
|
fb8a8a3fa5 | ||
|
50b4ebda71 | ||
|
2255a901be | ||
|
24b5683090 | ||
f63535f0d3 | |||
|
95a39eefb8 | ||
63fce9309c | |||
2214c533d0 | |||
|
48b191e345 | ||
|
b33b694547 | ||
|
67c2e366c5 | ||
b3b3e2b8ee | |||
|
ba38b9b1d8 | ||
3068ef2994 | |||
|
65c47fe151 | ||
|
92efb4498d | ||
|
25d3463182 | ||
|
c269765c39 | ||
|
2de4f3ca82 | ||
|
619254a204 | ||
|
6ad697924a | ||
|
d6778d1455 | ||
|
a9ed0e58fd | ||
|
85d7aacb02 | ||
|
08f5909a9f | ||
|
1a0cf48515 | ||
|
7a80e52d3c | ||
|
4cdbe1ab92 | ||
|
c632489cf3 | ||
|
8b708ab597 | ||
239860d551 | |||
|
2b7f8cf2df | ||
|
2ccf102e5e | ||
|
622b359e1f | ||
|
fb2fda38bb | ||
|
67a02034f1 | ||
fd6e0d967b | |||
|
f13fb375e7 | ||
|
b63b97e54d | ||
|
3ed3475e6a | ||
|
e8fe978d42 | ||
|
2807140c65 | ||
|
0485df95cf | ||
|
b49a8f33f6 | ||
49660c51a2 | |||
|
ec75dfed5d | ||
ad825f534f |
18
.env.example
18
.env.example
@ -1,13 +1,13 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_KEY=base64:wEWXUAAyjMhebMbczeMSiTGcEfi6YRVy/ZgB+u+cDRE=
|
||||
APP_DEBUG=true
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_LOCALE=en
|
||||
APP_LOCALE=ru
|
||||
APP_FALLBACK_LOCALE=en
|
||||
APP_FAKER_LOCALE=en_US
|
||||
APP_FAKER_LOCALE=ru_RU
|
||||
|
||||
APP_MAINTENANCE_DRIVER=file
|
||||
APP_MAINTENANCE_STORE=database
|
||||
@ -19,12 +19,12 @@ LOG_STACK=single
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
DB_CONNECTION=pgsql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=5432
|
||||
DB_DATABASE=edu_diary
|
||||
DB_USERNAME=postgres
|
||||
DB_PASSWORD=qwerty123
|
||||
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=120
|
||||
|
43
app/Console/Commands/AddAdmin.php
Normal file
43
app/Console/Commands/AddAdmin.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class AddAdmin extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:add-admin';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Create new admin';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$admin = Admin::create();
|
||||
|
||||
$user = User::create([
|
||||
'email' => 'admin' . $admin->id . '@mail',
|
||||
'password' => 'password',
|
||||
]);
|
||||
|
||||
$admin->user()->save($user);
|
||||
|
||||
$this->info('Admin created successfully!');
|
||||
$this->info('email = ' . $user->email);
|
||||
$this->info('password = password');
|
||||
}
|
||||
}
|
43
app/Console/Commands/AddScores.php
Normal file
43
app/Console/Commands/AddScores.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Grade;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class AddScores extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:add-scores {grade}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Add 4 and 5 scores for students';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$grade = Grade::firstWhere('id', $this->argument('grade'));
|
||||
|
||||
$grade->students->random(7)->each(function ($student) {
|
||||
$student
|
||||
->lessons()
|
||||
->syncWithPivotValues($student->lessons()->pluck('id'), ['score' => 4]);
|
||||
});
|
||||
|
||||
$grade->students->random(5)->each(function ($student) {
|
||||
$student
|
||||
->lessons()
|
||||
->syncWithPivotValues($student->lessons()->pluck('id'), ['score' => 5]);
|
||||
});
|
||||
}
|
||||
}
|
24
app/Enums/ScoreEnum.php
Normal file
24
app/Enums/ScoreEnum.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ScoreEnum: string
|
||||
{
|
||||
case WithoutScore = 'Без оценки';
|
||||
case Two = '2';
|
||||
case Three = '3';
|
||||
case Four = '4';
|
||||
case Five = '5';
|
||||
case Absent = 'Н';
|
||||
case Sick = 'Б';
|
||||
|
||||
public static function getNumScores(): array
|
||||
{
|
||||
return [self::Two, self::Three, self::Four, self::Five];
|
||||
}
|
||||
|
||||
public static function getDebtScores(): array
|
||||
{
|
||||
return [self::Absent, self::Sick];
|
||||
}
|
||||
}
|
23
app/Enums/TypeLesson.php
Normal file
23
app/Enums/TypeLesson.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum TypeLesson: string
|
||||
{
|
||||
case Homework = "Домашняя работа";
|
||||
case Classwork = "Работа в классе";
|
||||
case TestClass = "Самостоятельная работа";
|
||||
case ExamClass = "Контрольная работа";
|
||||
|
||||
public static function getShortType($type)
|
||||
{
|
||||
|
||||
return match ($type) {
|
||||
self::Homework->value => "д/р",
|
||||
self::Classwork->value => "кл/р",
|
||||
self::TestClass->value => "с/р",
|
||||
self::ExamClass->value => "к/р",
|
||||
default => "-",
|
||||
};
|
||||
}
|
||||
}
|
73
app/Export/JournalExport.php
Normal file
73
app/Export/JournalExport.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Export;
|
||||
|
||||
use App\Enums\ScoreEnum;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithStyles;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class JournalExport implements FromCollection, ShouldAutoSize, WithTitle, WithStyles
|
||||
{
|
||||
protected $lessons;
|
||||
protected $students;
|
||||
|
||||
public function __construct($lessons, $students)
|
||||
{
|
||||
$this->lessons = $lessons;
|
||||
$this->students = $students;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
$result = collect();
|
||||
|
||||
$headRow = collect();
|
||||
$headRow->push('');
|
||||
|
||||
$this->lessons->each(function ($lesson) use ($headRow) {
|
||||
$headRow->push($lesson->date);
|
||||
});
|
||||
$result->push($headRow);
|
||||
|
||||
$headRow = collect();
|
||||
$headRow->push('ФИО');
|
||||
|
||||
$this->lessons->each(function ($lesson) use ($headRow) {
|
||||
$headRow->push($lesson->shortType);
|
||||
});
|
||||
|
||||
$result->push($headRow);
|
||||
|
||||
$this->students->each(function ($student) use ($result){
|
||||
$row = collect();
|
||||
$row->push($student->fio);
|
||||
|
||||
$this->lessons->each(function ($lesson) use ($row, $student) {
|
||||
$row->push($student->lessons->find($lesson->id)->pivot->score ?? ScoreEnum::WithoutScore);
|
||||
});
|
||||
|
||||
$result->push($row);
|
||||
});
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function title(): string
|
||||
{
|
||||
return 'Журнал';
|
||||
}
|
||||
|
||||
public function styles(Worksheet $sheet)
|
||||
{
|
||||
$sheet->getStyle($sheet->calculateWorksheetDimension())
|
||||
->getAlignment()
|
||||
->setHorizontal(Alignment::HORIZONTAL_CENTER);
|
||||
}
|
||||
}
|
47
app/Http/Controllers/Auth/AuthenticatedSessionController.php
Normal file
47
app/Http/Controllers/Auth/AuthenticatedSessionController.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Auth\LoginRequest;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AuthenticatedSessionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the login view.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming authentication request.
|
||||
*/
|
||||
public function store(LoginRequest $request): RedirectResponse
|
||||
{
|
||||
$request->authenticate();
|
||||
|
||||
$request->session()->regenerate();
|
||||
|
||||
return redirect()->intended(route('dashboard', absolute: false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy an authenticated session.
|
||||
*/
|
||||
public function destroy(Request $request): RedirectResponse
|
||||
{
|
||||
Auth::guard('web')->logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
40
app/Http/Controllers/Auth/ConfirmablePasswordController.php
Normal file
40
app/Http/Controllers/Auth/ConfirmablePasswordController.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ConfirmablePasswordController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the confirm password view.
|
||||
*/
|
||||
public function show(): View
|
||||
{
|
||||
return view('auth.confirm-password');
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm the user's password.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
if (! Auth::guard('web')->validate([
|
||||
'email' => $request->user()->email,
|
||||
'password' => $request->password,
|
||||
])) {
|
||||
throw ValidationException::withMessages([
|
||||
'password' => __('auth.password'),
|
||||
]);
|
||||
}
|
||||
|
||||
$request->session()->put('auth.password_confirmed_at', time());
|
||||
|
||||
return redirect()->intended(route('dashboard', absolute: false));
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EmailVerificationNotificationController extends Controller
|
||||
{
|
||||
/**
|
||||
* Send a new email verification notification.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
if ($request->user()->hasVerifiedEmail()) {
|
||||
return redirect()->intended(route('dashboard', absolute: false));
|
||||
}
|
||||
|
||||
$request->user()->sendEmailVerificationNotification();
|
||||
|
||||
return back()->with('status', 'verification-link-sent');
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class EmailVerificationPromptController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the email verification prompt.
|
||||
*/
|
||||
public function __invoke(Request $request): RedirectResponse|View
|
||||
{
|
||||
return $request->user()->hasVerifiedEmail()
|
||||
? redirect()->intended(route('dashboard', absolute: false))
|
||||
: view('auth.verify-email');
|
||||
}
|
||||
}
|
61
app/Http/Controllers/Auth/NewPasswordController.php
Normal file
61
app/Http/Controllers/Auth/NewPasswordController.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Auth\Events\PasswordReset;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rules;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class NewPasswordController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the password reset view.
|
||||
*/
|
||||
public function create(Request $request): View
|
||||
{
|
||||
return view('auth.reset-password', ['request' => $request]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming new password request.
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'token' => ['required'],
|
||||
'email' => ['required', 'email'],
|
||||
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||
]);
|
||||
|
||||
// Here we will attempt to reset the user's password. If it is successful we
|
||||
// will update the password on an actual user model and persist it to the
|
||||
// database. Otherwise we will parse the error and return the response.
|
||||
$status = Password::reset(
|
||||
$request->only('email', 'password', 'password_confirmation', 'token'),
|
||||
function ($user) use ($request) {
|
||||
$user->forceFill([
|
||||
'password' => Hash::make($request->password),
|
||||
'remember_token' => Str::random(60),
|
||||
])->save();
|
||||
|
||||
event(new PasswordReset($user));
|
||||
}
|
||||
);
|
||||
|
||||
// If the password was successfully reset, we will redirect the user back to
|
||||
// the application's home authenticated view. If there is an error we can
|
||||
// redirect them back to where they came from with their error message.
|
||||
return $status == Password::PASSWORD_RESET
|
||||
? redirect()->route('login')->with('status', __($status))
|
||||
: back()->withInput($request->only('email'))
|
||||
->withErrors(['email' => __($status)]);
|
||||
}
|
||||
}
|
29
app/Http/Controllers/Auth/PasswordController.php
Normal file
29
app/Http/Controllers/Auth/PasswordController.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
|
||||
class PasswordController extends Controller
|
||||
{
|
||||
/**
|
||||
* Update the user's password.
|
||||
*/
|
||||
public function update(Request $request): RedirectResponse
|
||||
{
|
||||
$validated = $request->validateWithBag('updatePassword', [
|
||||
'current_password' => ['required', 'current_password'],
|
||||
'password' => ['required', Password::defaults(), 'confirmed'],
|
||||
]);
|
||||
|
||||
$request->user()->update([
|
||||
'password' => Hash::make($validated['password']),
|
||||
]);
|
||||
|
||||
return back()->with('status', 'password-updated');
|
||||
}
|
||||
}
|
44
app/Http/Controllers/Auth/PasswordResetLinkController.php
Normal file
44
app/Http/Controllers/Auth/PasswordResetLinkController.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class PasswordResetLinkController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the password reset link request view.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
return view('auth.forgot-password');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming password reset link request.
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'email' => ['required', 'email'],
|
||||
]);
|
||||
|
||||
// We will send the password reset link to this user. Once we have attempted
|
||||
// to send the link, we will examine the response then see the message we
|
||||
// need to show to the user. Finally, we'll send out a proper response.
|
||||
$status = Password::sendResetLink(
|
||||
$request->only('email')
|
||||
);
|
||||
|
||||
return $status == Password::RESET_LINK_SENT
|
||||
? back()->with('status', __($status))
|
||||
: back()->withInput($request->only('email'))
|
||||
->withErrors(['email' => __($status)]);
|
||||
}
|
||||
}
|
50
app/Http/Controllers/Auth/RegisteredUserController.php
Normal file
50
app/Http/Controllers/Auth/RegisteredUserController.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Validation\Rules;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class RegisteredUserController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the registration view.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming registration request.
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class],
|
||||
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||
]);
|
||||
|
||||
$user = User::create([
|
||||
'name' => $request->name,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($request->password),
|
||||
]);
|
||||
|
||||
event(new Registered($user));
|
||||
|
||||
Auth::login($user);
|
||||
|
||||
return redirect(route('dashboard', absolute: false));
|
||||
}
|
||||
}
|
27
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
27
app/Http/Controllers/Auth/VerifyEmailController.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Auth\Events\Verified;
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class VerifyEmailController extends Controller
|
||||
{
|
||||
/**
|
||||
* Mark the authenticated user's email address as verified.
|
||||
*/
|
||||
public function __invoke(EmailVerificationRequest $request): RedirectResponse
|
||||
{
|
||||
if ($request->user()->hasVerifiedEmail()) {
|
||||
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
|
||||
}
|
||||
|
||||
if ($request->user()->markEmailAsVerified()) {
|
||||
event(new Verified($request->user()));
|
||||
}
|
||||
|
||||
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
|
||||
}
|
||||
}
|
@ -4,53 +4,75 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\GradePostRequest;
|
||||
use App\Models\Grade;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Services\FileService;
|
||||
use App\Services\GradeService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class GradeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(GradeService $service): View
|
||||
{
|
||||
if(request()->user()->cannot('viewAny', Grade::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grades.index', [
|
||||
'grades' => Grade::filter()->paginate(10)->withQueryString(),
|
||||
'grades' => $service->getGrades(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View
|
||||
{
|
||||
if(request()->user()->cannot('create', Grade::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grades.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(GradePostRequest $request)
|
||||
public function store(GradePostRequest $request): RedirectResponse
|
||||
{
|
||||
$grade = Grade::create($request->validated());
|
||||
if(request()->user()->cannot('create', Grade::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return redirect()->route('grades.show', $grade);
|
||||
return redirect()->route('grades.show', Grade::create($request->validated()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Grade $grade)
|
||||
public function show(Grade $grade): View
|
||||
{
|
||||
if(request()->user()->cannot('view', $grade)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grades.show', [
|
||||
'grade' => $grade,
|
||||
'grade' => $grade,
|
||||
'subjects' => $grade->subjects,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Grade $grade)
|
||||
public function edit(Grade $grade): View
|
||||
{
|
||||
if(request()->user()->cannot('update', $grade)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grades.edit', [
|
||||
'grade' => $grade,
|
||||
]);
|
||||
@ -59,8 +81,12 @@ class GradeController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(GradePostRequest $request, Grade $grade)
|
||||
public function update(GradePostRequest $request, Grade $grade): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $grade)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$grade->update($request->validated());
|
||||
|
||||
return redirect()->route('grades.show', $grade);
|
||||
@ -69,10 +95,19 @@ class GradeController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Grade $grade)
|
||||
public function destroy(Grade $grade): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('delete', $grade)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$grade->delete();
|
||||
|
||||
return redirect()->route('grades.index');
|
||||
}
|
||||
|
||||
public function listStudents(Grade $grade, FileService $fileService)
|
||||
{
|
||||
return $fileService->exportStudents($grade);
|
||||
}
|
||||
}
|
||||
|
51
app/Http/Controllers/GradeSubjectController.php
Normal file
51
app/Http/Controllers/GradeSubjectController.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\GradeSubjectPostRequest;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Subject;
|
||||
use App\Services\FileService;
|
||||
use App\Services\JournalService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class GradeSubjectController extends Controller
|
||||
{
|
||||
public function create(Grade $grade): View
|
||||
{
|
||||
return view('grade-subject.create', [
|
||||
'grade' => $grade,
|
||||
'subjects' => Subject::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(GradeSubjectPostRequest $request, Grade $grade): RedirectResponse
|
||||
{
|
||||
$grade->subjects()->syncWithoutDetaching($request->subject_id);
|
||||
|
||||
return redirect()->route('grades.show', $grade);
|
||||
}
|
||||
|
||||
public function destroy(Grade $grade, Subject $subject): RedirectResponse
|
||||
{
|
||||
$grade->subjects()->detach($subject);
|
||||
|
||||
return redirect()->route('grades.show', $grade);
|
||||
}
|
||||
|
||||
public function journal(Grade $grade, Subject $subject, JournalService $service): View
|
||||
{
|
||||
return view('grade-subject.journal', [
|
||||
'lessons' => $grade->lessons()->where('subject_id', $subject->id)->with('students')->get(),
|
||||
'students' => $grade->students()->orderBy('last_name')->get(),
|
||||
'grade' => $grade,
|
||||
'subject' => $subject,
|
||||
]);
|
||||
}
|
||||
|
||||
public function exportToExcel(Grade $grade, Subject $subject, FileService $service)
|
||||
{
|
||||
return $service->exportJournal($grade, $subject);
|
||||
}
|
||||
}
|
63
app/Http/Controllers/GradeTeacherController.php
Normal file
63
app/Http/Controllers/GradeTeacherController.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\GradeTeacherPostRequest;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Teacher;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class GradeTeacherController extends Controller
|
||||
{
|
||||
public function create(Teacher $teacher, Subject $subject): View
|
||||
{
|
||||
return view('grade-teacher.create', [
|
||||
'teacher' => $teacher,
|
||||
'subject' => $subject,
|
||||
'grades' => $subject->grades,
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(GradeTeacherPostRequest $request, Teacher $teacher, Subject $subject): RedirectResponse
|
||||
{
|
||||
$teacher->grades()->syncWithoutDetaching($request->grade_id);
|
||||
|
||||
return redirect()->route('teachers.subjects.show', [
|
||||
$teacher,
|
||||
$subject,
|
||||
]);
|
||||
}
|
||||
|
||||
public function edit(Teacher $teacher, Subject $subject, Grade $grade): View
|
||||
{
|
||||
return view('grade-teacher.edit', [
|
||||
'teacher' => $teacher,
|
||||
'subject' => $subject,
|
||||
'updateGrade' => $grade,
|
||||
'grades' => $subject->grades,
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(GradeTeacherPostRequest $request, Teacher $teacher, Subject $subject, Grade $grade): RedirectResponse
|
||||
{
|
||||
$teacher->grades()->detach($grade);
|
||||
$teacher->grades()->attach($request->grade_id);
|
||||
|
||||
return redirect()->route('teachers.subjects.show', [
|
||||
$teacher,
|
||||
$subject,
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy(Teacher $teacher, Subject $subject, Grade $grade): RedirectResponse
|
||||
{
|
||||
$teacher->grades()->detach($grade);
|
||||
|
||||
return redirect()->route('teachers.subjects.show', [
|
||||
$teacher,
|
||||
$subject,
|
||||
]);
|
||||
}
|
||||
}
|
134
app/Http/Controllers/LessonController.php
Normal file
134
app/Http/Controllers/LessonController.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\ScoreEnum;
|
||||
use App\Enums\TypeLesson;
|
||||
use App\Http\Requests\LessonPostRequest;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Lesson;
|
||||
use App\Services\LessonService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class LessonController extends Controller
|
||||
{
|
||||
public function gradeList(): View
|
||||
{
|
||||
return view('grade-lesson.grades-list', [
|
||||
'grades' => Grade::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Grade $grade, LessonService $service): View
|
||||
{
|
||||
if(request()->user()->cannot('viewAny', $grade)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grade-lesson.index', [
|
||||
'lessons' => $service->getLessons($grade),
|
||||
'grade' => $grade,
|
||||
'subjects' => $grade->subjects,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create(Grade $grade): View
|
||||
{
|
||||
if(request()->user()->cannot('create', Lesson::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grade-lesson.create', [
|
||||
'types' => TypeLesson::cases(),
|
||||
'grade' => $grade,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(LessonPostRequest $request, Grade $grade): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('create', [Lesson::class, $grade])) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$lesson = Lesson::create($request->validated());
|
||||
$lesson
|
||||
->students()
|
||||
->syncWithPivotValues($lesson->grade->students->pluck('id')->all(), ['score' => ScoreEnum::WithoutScore]);
|
||||
|
||||
return redirect()->route(
|
||||
'grades.lessons.show', [
|
||||
$grade,
|
||||
$lesson,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Grade $grade, Lesson $lesson): View
|
||||
{
|
||||
if(request()->user()->cannot('view', $lesson)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grade-lesson.show', [
|
||||
'lesson' => $lesson,
|
||||
'grade' => $grade,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Grade $grade, Lesson $lesson): View
|
||||
{
|
||||
if(request()->user()->cannot('update', $lesson)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('grade-lesson.edit', [
|
||||
'lesson' => $lesson,
|
||||
'grade' => $grade,
|
||||
'types' => TypeLesson::cases(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(LessonPostRequest $request, Grade $grade, Lesson $lesson): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $lesson)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$lesson->update($request->validated());
|
||||
|
||||
return redirect()->route('grades.lessons.show',[$grade, $lesson,]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Grade $grade, Lesson $lesson): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $lesson)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$lesson->delete();
|
||||
|
||||
return redirect()->route('grades.lessons.index', $grade);
|
||||
}
|
||||
}
|
60
app/Http/Controllers/ProfileController.php
Normal file
60
app/Http/Controllers/ProfileController.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\ProfileUpdateRequest;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the user's profile form.
|
||||
*/
|
||||
public function edit(Request $request): View
|
||||
{
|
||||
return view('profile.edit', [
|
||||
'user' => $request->user(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the user's profile information.
|
||||
*/
|
||||
public function update(ProfileUpdateRequest $request): RedirectResponse
|
||||
{
|
||||
$request->user()->fill($request->validated());
|
||||
|
||||
if ($request->user()->isDirty('email')) {
|
||||
$request->user()->email_verified_at = null;
|
||||
}
|
||||
|
||||
$request->user()->save();
|
||||
|
||||
return Redirect::route('profile.edit')->with('status', 'profile-updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the user's account.
|
||||
*/
|
||||
public function destroy(Request $request): RedirectResponse
|
||||
{
|
||||
$request->validateWithBag('userDeletion', [
|
||||
'password' => ['required', 'current_password'],
|
||||
]);
|
||||
|
||||
$user = $request->user();
|
||||
|
||||
Auth::logout();
|
||||
|
||||
$user->delete();
|
||||
|
||||
$request->session()->invalidate();
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
return Redirect::to('/');
|
||||
}
|
||||
}
|
33
app/Http/Controllers/ScoreController.php
Normal file
33
app/Http/Controllers/ScoreController.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\ScoreEnum;
|
||||
use App\Models\Lesson;
|
||||
use App\Services\ScoreService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ScoreController extends Controller
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
protected ScoreService $service,
|
||||
){
|
||||
}
|
||||
|
||||
public function show(Lesson $lesson)
|
||||
{
|
||||
return view('scores.show', [
|
||||
'students' => $lesson->students()->orderBy('last_name')->get(),
|
||||
'lesson' => $lesson,
|
||||
'scores' => ScoreEnum::cases(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(Request $request, Lesson $lesson)
|
||||
{
|
||||
$this->service->update($lesson, $request->toArray());
|
||||
|
||||
return redirect()->route('grades.lessons.show', [$lesson->grade, $lesson]);
|
||||
}
|
||||
}
|
143
app/Http/Controllers/StudentController.php
Normal file
143
app/Http/Controllers/StudentController.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\StudentPostRequest;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Student;
|
||||
use App\Models\Subject;
|
||||
use App\Services\FileService;
|
||||
use App\Services\StudentService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class StudentController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
protected StudentService $service
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
if(request()->user()->cannot('viewAny', Student::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('students.index', [
|
||||
'students' => Student::filter()->paginate(5)->withQueryString(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
if(request()->user()->cannot('create', Student::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('students.create', [
|
||||
'grades' => Grade::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(StudentPostRequest $request): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('create', Student::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return redirect()->route(
|
||||
'students.show',
|
||||
$this->service->create($request->validated())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Student $student): View
|
||||
{
|
||||
if(request()->user()->cannot('view', $student)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('students.show', [
|
||||
'student' => $student,
|
||||
'grades' => Grade::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Student $student): View
|
||||
{
|
||||
if(request()->user()->cannot('update', $student)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('students.edit', [
|
||||
'student' => $student,
|
||||
'grades' => Grade::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(StudentPostRequest $request, Student $student): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $student)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return redirect()->route(
|
||||
'students.show',
|
||||
$this->service->update($student, $request->validated())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Student $student): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('delete', $student)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$student->user()->delete();
|
||||
$student->delete();
|
||||
|
||||
return redirect()->route('students.index');
|
||||
}
|
||||
|
||||
public function scores(StudentService $service, Subject $subject): View
|
||||
{
|
||||
return view('students.scores', [
|
||||
'lessons' => $service->getScores($subject),
|
||||
'avgScore' => $service->getAvgScore($subject),
|
||||
]);
|
||||
}
|
||||
|
||||
public function debts(StudentService $service): View
|
||||
{
|
||||
return view('students.debts', [
|
||||
'lessons' => $service->getDebts(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function exportAvgScores(StudentService $service)
|
||||
{
|
||||
return $service->exportAvgScores();
|
||||
}
|
||||
}
|
108
app/Http/Controllers/SubjectController.php
Normal file
108
app/Http/Controllers/SubjectController.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\SubjectPostRequest;
|
||||
use App\Models\Subject;
|
||||
|
||||
use App\Services\SubjectService;
|
||||
use App\Services\FileService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class SubjectController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(SubjectService $service): View
|
||||
{
|
||||
return view('subjects.index', [
|
||||
'subjects' => $service->getSubjects(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
if(request()->user()->cannot('create', Subject::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('subjects.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(SubjectPostRequest $request): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('create', Subject::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return redirect()->route(
|
||||
'subjects.show',
|
||||
Subject::create($request->validated()),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Subject $subject): View
|
||||
{
|
||||
return view('subjects.show', [
|
||||
'subject' => $subject,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Subject $subject): View
|
||||
{
|
||||
if(request()->user()->cannot('update', $subject)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('subjects.edit', [
|
||||
'subject' => $subject,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(SubjectPostRequest $request, Subject $subject): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $subject)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$subject->update($request->validated());
|
||||
|
||||
return redirect()->route('subjects.show', $subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Subject $subject): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('delete', $subject)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$subject->delete();
|
||||
|
||||
return redirect()->route('subjects.index');
|
||||
}
|
||||
|
||||
public function exportToPDF(FileService $fileService)
|
||||
{
|
||||
return $fileService->exportSubjects();
|
||||
}
|
||||
}
|
71
app/Http/Controllers/SubjectTeacherController.php
Normal file
71
app/Http/Controllers/SubjectTeacherController.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\SubjectTeacherPostRequest;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Teacher;
|
||||
use App\Services\TeacherService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class SubjectTeacherController extends Controller
|
||||
{
|
||||
public function index(Teacher $teacher, TeacherService $service)
|
||||
{
|
||||
return view('subject-teacher.index', [
|
||||
'subjects' => $service->getSubjects($teacher),
|
||||
]);
|
||||
}
|
||||
|
||||
public function create(Teacher $teacher): View
|
||||
{
|
||||
return view('subject-teacher.create', [
|
||||
'teacher' => $teacher,
|
||||
'subjects' => Subject::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function store(SubjectTeacherPostRequest $request, Teacher $teacher): RedirectResponse
|
||||
{
|
||||
$teacher->subjects()->syncWithoutDetaching($request->subject_id);
|
||||
|
||||
return redirect()->route('teachers.show', $teacher);
|
||||
}
|
||||
|
||||
public function show(Teacher $teacher, Subject $subject): View
|
||||
{
|
||||
return view('subject-teacher.show', [
|
||||
'teacher' => $teacher,
|
||||
'subject' => $subject,
|
||||
'grades' => $teacher
|
||||
->grades()
|
||||
->join('grade_subject', 'grades.id', '=', 'grade_subject.grade_id')
|
||||
->where('subject_id', $subject->id)->get(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function edit(Teacher $teacher, Subject $subject): View
|
||||
{
|
||||
return view('subject-teacher.edit', [
|
||||
'teacher' => $teacher,
|
||||
'updateSubject' => $subject,
|
||||
'subjects' => Subject::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function update(SubjectTeacherPostRequest $request, Teacher $teacher, Subject $subject): RedirectResponse
|
||||
{
|
||||
$teacher->subjects()->detach($subject);
|
||||
$teacher->subjects()->attach($request->subject_id);
|
||||
|
||||
return redirect()->route('teachers.show', $teacher);
|
||||
}
|
||||
|
||||
public function destroy(Teacher $teacher, Subject $subject): RedirectResponse
|
||||
{
|
||||
$teacher->subjects()->detach($subject);
|
||||
|
||||
return redirect()->route('teachers.show', $teacher);
|
||||
}
|
||||
}
|
117
app/Http/Controllers/TeacherController.php
Normal file
117
app/Http/Controllers/TeacherController.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\TeacherPostRequest;
|
||||
use App\Models\Teacher;
|
||||
use App\Services\TeacherService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class TeacherController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
protected TeacherService $service
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(TeacherService $service): View
|
||||
{
|
||||
if(request()->user()->cannot('viewAny', Teacher::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('teachers.index', [
|
||||
'teachers' => $service->getTeachers(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create(): View
|
||||
{
|
||||
if(request()->user()->cannot('create', Teacher::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('teachers.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(TeacherPostRequest $request): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('create', Teacher::class)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return redirect()->route(
|
||||
'teachers.show',
|
||||
$this->service->create($request->validated())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Teacher $teacher): View
|
||||
{
|
||||
if(request()->user()->cannot('view', $teacher)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('teachers.show', [
|
||||
'teacher' => $teacher,
|
||||
'subjects' => $teacher->subjects,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(Teacher $teacher): View
|
||||
{
|
||||
if(request()->user()->cannot('update', $teacher)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return view('teachers.edit', [
|
||||
'teacher' => $teacher,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(TeacherPostRequest $request, Teacher $teacher): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $teacher)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return redirect()->route(
|
||||
'teachers.show',
|
||||
$this->service->update($teacher, $request->validated())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(Teacher $teacher): RedirectResponse
|
||||
{
|
||||
if(request()->user()->cannot('update', $teacher)) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$teacher->user()->delete();
|
||||
$teacher->delete();
|
||||
|
||||
return redirect()->route('teachers.index');
|
||||
}
|
||||
}
|
26
app/Http/Middleware/AdminAction.php
Normal file
26
app/Http/Middleware/AdminAction.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\Admin;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class AdminAction
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (Auth::user()->userable_type != Admin::class) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
26
app/Http/Middleware/StudentAction.php
Normal file
26
app/Http/Middleware/StudentAction.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\Student;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class StudentAction
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (Auth::user()->userable_type != Student::class) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
26
app/Http/Middleware/TeacherAction.php
Normal file
26
app/Http/Middleware/TeacherAction.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\Teacher;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class TeacherAction
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (Auth::user()->userable_type != Teacher::class) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
85
app/Http/Requests/Auth/LoginRequest.php
Normal file
85
app/Http/Requests/Auth/LoginRequest.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Auth\Events\Lockout;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'string', 'email'],
|
||||
'password' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to authenticate the request's credentials.
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function authenticate(): void
|
||||
{
|
||||
$this->ensureIsNotRateLimited();
|
||||
|
||||
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
|
||||
RateLimiter::hit($this->throttleKey());
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
'email' => trans('auth.failed'),
|
||||
]);
|
||||
}
|
||||
|
||||
RateLimiter::clear($this->throttleKey());
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure the login request is not rate limited.
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function ensureIsNotRateLimited(): void
|
||||
{
|
||||
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event(new Lockout($this));
|
||||
|
||||
$seconds = RateLimiter::availableIn($this->throttleKey());
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
'email' => trans('auth.throttle', [
|
||||
'seconds' => $seconds,
|
||||
'minutes' => ceil($seconds / 60),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the rate limiting throttle key for the request.
|
||||
*/
|
||||
public function throttleKey(): string
|
||||
{
|
||||
return Str::transliterate(Str::lower($this->string('email')).'|'.$this->ip());
|
||||
}
|
||||
}
|
28
app/Http/Requests/GradeSubjectPostRequest.php
Normal file
28
app/Http/Requests/GradeSubjectPostRequest.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GradeSubjectPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'subject_id' => 'required|exists:subjects,id',
|
||||
];
|
||||
}
|
||||
}
|
28
app/Http/Requests/GradeTeacherPostRequest.php
Normal file
28
app/Http/Requests/GradeTeacherPostRequest.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GradeTeacherPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'grade_id' => 'required|exists:grades,id',
|
||||
];
|
||||
}
|
||||
}
|
36
app/Http/Requests/LessonPostRequest.php
Normal file
36
app/Http/Requests/LessonPostRequest.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Enums\TypeLesson;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class LessonPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:255',
|
||||
'type' => ['required', Rule::in(TypeLesson::cases())],
|
||||
'lesson_date' => 'required|date',
|
||||
'description' => 'nullable|string|max:250',
|
||||
'grade_id' => 'required|exists:grades,id',
|
||||
'teacher_id' => 'required|exists:teachers,id',
|
||||
'subject_id' => 'required|exists:subjects,id',
|
||||
];
|
||||
}
|
||||
}
|
23
app/Http/Requests/ProfileUpdateRequest.php
Normal file
23
app/Http/Requests/ProfileUpdateRequest.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class ProfileUpdateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
|
||||
];
|
||||
}
|
||||
}
|
28
app/Http/Requests/ScorePostRequest.php
Normal file
28
app/Http/Requests/ScorePostRequest.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ScorePostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
36
app/Http/Requests/StudentPostRequest.php
Normal file
36
app/Http/Requests/StudentPostRequest.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StudentPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
'last_name' => 'required|max:255',
|
||||
'middle_name' => 'required|max:255',
|
||||
'birthday' => 'required|date',
|
||||
'grade_id' => 'required|exists:grades,id',
|
||||
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->route('student')?->user->id), 'regex:/^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0–9]{1,3}\.[0–9]{1,3}\.[0–9]{1,3}\.[0–9]{1,3}])|(([a-zA-Z\-0–9]+\.)+[a-zA-Z]{2,}))$/'],
|
||||
'password' => 'required|max:255',
|
||||
];
|
||||
}
|
||||
}
|
28
app/Http/Requests/SubjectPostRequest.php
Normal file
28
app/Http/Requests/SubjectPostRequest.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SubjectPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:subjects|max:255',
|
||||
];
|
||||
}
|
||||
}
|
28
app/Http/Requests/SubjectTeacherPostRequest.php
Normal file
28
app/Http/Requests/SubjectTeacherPostRequest.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SubjectTeacherPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'subject_id' => 'required|exists:subjects,id',
|
||||
];
|
||||
}
|
||||
}
|
35
app/Http/Requests/TeacherPostRequest.php
Normal file
35
app/Http/Requests/TeacherPostRequest.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class TeacherPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
'last_name' => 'required|max:255',
|
||||
'middle_name' => 'required|max:255',
|
||||
'birthday' => 'required|date',
|
||||
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->route('teacher')?->user->id), 'regex:/^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0–9]{1,3}\.[0–9]{1,3}\.[0–9]{1,3}\.[0–9]{1,3}])|(([a-zA-Z\-0–9]+\.)+[a-zA-Z]{2,}))$/'],
|
||||
'password' => 'required|max:255',
|
||||
];
|
||||
}
|
||||
}
|
52
app/Mail/UserCreated.php
Normal file
52
app/Mail/UserCreated.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class UserCreated extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(public string $password)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'Создана учетная запись',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'mails.user_created',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
17
app/Models/Admin.php
Normal file
17
app/Models/Admin.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
|
||||
class Admin extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function user(): MorphOne
|
||||
{
|
||||
return $this->morphOne(User::class, 'userable');
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ namespace App\Models;
|
||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Grade extends Model
|
||||
{
|
||||
@ -14,7 +16,27 @@ class Grade extends Model
|
||||
'name',
|
||||
];
|
||||
|
||||
public function scopeFilter(Builder $query)
|
||||
public function subjects(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Subject::class);
|
||||
}
|
||||
|
||||
public function students(): HasMany
|
||||
{
|
||||
return $this->hasMany(Student::class);
|
||||
}
|
||||
|
||||
public function teachers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Teacher::class);
|
||||
}
|
||||
|
||||
public function lessons(): HasMany
|
||||
{
|
||||
return $this->hasMany(Lesson::class);
|
||||
}
|
||||
|
||||
public function scopeFilter(Builder $query): void
|
||||
{
|
||||
$name = request('name');
|
||||
|
||||
|
70
app/Models/Lesson.php
Normal file
70
app/Models/Lesson.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\TypeLesson;
|
||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class Lesson extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'type',
|
||||
'description',
|
||||
'lesson_date',
|
||||
'grade_id',
|
||||
'teacher_id',
|
||||
'subject_id',
|
||||
];
|
||||
|
||||
public function grade(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Grade::class);
|
||||
}
|
||||
|
||||
public function teacher(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Teacher::class);
|
||||
}
|
||||
|
||||
public function subject(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Subject::class);
|
||||
}
|
||||
|
||||
public function students(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Student::class)->withPivot('score');
|
||||
}
|
||||
|
||||
public function scopeFilter(Builder $query): void
|
||||
{
|
||||
$subject_id = request('subject_id');
|
||||
|
||||
$query->when($subject_id, function (Builder $query, $subject_id) {
|
||||
$query->where('subject_id', $subject_id);
|
||||
});
|
||||
}
|
||||
|
||||
public function shortType(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => TypeLesson::getShortType($this->type),
|
||||
);
|
||||
}
|
||||
|
||||
protected function date(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => Carbon::parse($this->lesson_date)->format('d-m-Y')
|
||||
);
|
||||
}
|
||||
}
|
64
app/Models/Student.php
Normal file
64
app/Models/Student.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
|
||||
class Student extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'last_name',
|
||||
'middle_name',
|
||||
'birthday',
|
||||
'grade_id',
|
||||
];
|
||||
|
||||
public function grade(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Grade::class);
|
||||
}
|
||||
|
||||
public function user(): MorphOne
|
||||
{
|
||||
return $this->morphOne(User::class, 'userable');
|
||||
}
|
||||
|
||||
public function subjects(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Subject::class);
|
||||
}
|
||||
|
||||
public function lessons(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Lesson::class)->withPivot('score');
|
||||
}
|
||||
|
||||
public function scopeFilter(Builder $query): void
|
||||
{
|
||||
$name = request('name');
|
||||
$query->when($name, function (Builder $query, $name) {
|
||||
$query->whereRaw('CONCAT (name, \' \', last_name, \' \', middle_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (name, \' \', middle_name, \' \', last_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (last_name, \' \', name, \' \', middle_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (last_name, \' \', middle_name, \' \', name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (middle_name, \' \', name, \' \', last_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (middle_name, \' \', last_name, \' \', name) ilike ?', ["$name%"]);
|
||||
});
|
||||
}
|
||||
|
||||
public function fio(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => $this->last_name.' '.$this->name.' '.$this->middle_name,
|
||||
);
|
||||
}
|
||||
}
|
53
app/Models/Subject.php
Normal file
53
app/Models/Subject.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
|
||||
class Subject extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
];
|
||||
|
||||
public function grades(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Grade::class);
|
||||
}
|
||||
|
||||
public function teachers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Teacher::class);
|
||||
}
|
||||
|
||||
public function students(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Student::class)->using(Score::class);
|
||||
}
|
||||
|
||||
public function lessons(): HasMany
|
||||
{
|
||||
return $this->hasMany(Lesson::class);
|
||||
}
|
||||
|
||||
public function scopeFilter(Builder $query): void
|
||||
{
|
||||
$name = request('name');
|
||||
|
||||
$query->when($name, function (Builder $query, $name) {
|
||||
$query->whereRaw('name ilike ?', ["$name%"]);
|
||||
});
|
||||
}
|
||||
|
||||
public function user(): MorphOne
|
||||
{
|
||||
return $this->morphOne(User::class, 'userable');
|
||||
}
|
||||
}
|
63
app/Models/Teacher.php
Normal file
63
app/Models/Teacher.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
|
||||
class Teacher extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'last_name',
|
||||
'middle_name',
|
||||
'birthday',
|
||||
];
|
||||
|
||||
public function subjects(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Subject::class);
|
||||
}
|
||||
|
||||
public function grades(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Grade::class);
|
||||
}
|
||||
|
||||
public function user(): MorphOne
|
||||
{
|
||||
return $this->morphOne(User::class, 'userable');
|
||||
}
|
||||
|
||||
public function lessons(): HasMany
|
||||
{
|
||||
return $this->hasMany(Lesson::class);
|
||||
}
|
||||
|
||||
public function scopeFilter(Builder $query): void
|
||||
{
|
||||
$name = request('name');
|
||||
$query->when($name, function (Builder $query, $name) {
|
||||
$query->whereRaw('CONCAT (name, \' \', last_name, \' \', middle_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (name, \' \', middle_name, \' \', last_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (last_name, \' \', name, \' \', middle_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (last_name, \' \', middle_name, \' \', name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (middle_name, \' \', name, \' \', last_name) ilike ?', ["$name%"]);
|
||||
$query->orWhereRaw('CONCAT (middle_name, \' \', last_name, \' \', name) ilike ?', ["$name%"]);
|
||||
});
|
||||
}
|
||||
|
||||
public function fio(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => $this->last_name.' '.$this->name.' '.$this->middle_name,
|
||||
);
|
||||
}
|
||||
}
|
@ -3,10 +3,15 @@
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
|
||||
use App\Observers\UserObserver;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
#[ObservedBy(UserObserver::class)]
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasFactory, Notifiable;
|
||||
@ -17,7 +22,6 @@ class User extends Authenticatable
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
@ -44,4 +48,9 @@ class User extends Authenticatable
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function userable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
|
18
app/Observers/UserObserver.php
Normal file
18
app/Observers/UserObserver.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Mail\UserCreated;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class UserObserver
|
||||
{
|
||||
/**
|
||||
* Handle the User "created" event.
|
||||
*/
|
||||
public function created(User $user): void
|
||||
{
|
||||
Mail::to($user)->send(new UserCreated(request()->all()['password']));
|
||||
}
|
||||
}
|
62
app/Policies/GradePolicy.php
Normal file
62
app/Policies/GradePolicy.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Student;
|
||||
use App\Models\Teacher;
|
||||
use App\Models\User;
|
||||
|
||||
class GradePolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->userable_type != Student::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, Grade $grade): bool
|
||||
{
|
||||
return $user->userable_type != Student::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, Grade $grade): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, Grade $grade): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
public function journal(User $user)
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
|
||||
public function list(User $user)
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
}
|
53
app/Policies/LessonPolicy.php
Normal file
53
app/Policies/LessonPolicy.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Lesson;
|
||||
use App\Models\Student;
|
||||
use App\Models\Teacher;
|
||||
use App\Models\User;
|
||||
|
||||
class LessonPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, Lesson $lesson): bool
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, Lesson $lesson): bool
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, Lesson $lesson): bool
|
||||
{
|
||||
return $user->userable_type == Teacher::class;
|
||||
}
|
||||
}
|
60
app/Policies/StudentPolicy.php
Normal file
60
app/Policies/StudentPolicy.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\Student;
|
||||
use App\Models\User;
|
||||
|
||||
class StudentPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->userable_type != Student::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, Student $student): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, Student $student): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, Student $student): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
public function debts(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Student::class;
|
||||
}
|
||||
|
||||
public function avgScores(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Student::class;
|
||||
}
|
||||
}
|
50
app/Policies/SubjectPolicy.php
Normal file
50
app/Policies/SubjectPolicy.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\Student;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Teacher;
|
||||
use App\Models\User;
|
||||
|
||||
class SubjectPolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->userable_type != Teacher::class;
|
||||
}
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, Subject $subject): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, Subject $subject): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
public function scores(User $user, Subject $subject): bool
|
||||
{
|
||||
return $user->userable_type == Student::class;
|
||||
}
|
||||
|
||||
public function pdf(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Student::class;
|
||||
}
|
||||
}
|
56
app/Policies/TeacherPolicy.php
Normal file
56
app/Policies/TeacherPolicy.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Admin;
|
||||
use App\Models\Student;
|
||||
use App\Models\Teacher;
|
||||
use App\Models\User;
|
||||
|
||||
class TeacherPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->userable_type != Teacher::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, Teacher $teacher): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, Teacher $teacher): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, Teacher $teacher): bool
|
||||
{
|
||||
return $user->userable_type == Admin::class;
|
||||
}
|
||||
|
||||
public function teacherSubjects(User $user, Teacher $teacher): bool
|
||||
{
|
||||
return $user->userable_type == Student::class;
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@ -19,6 +20,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
Paginator::useBootstrap();
|
||||
}
|
||||
}
|
||||
|
64
app/Providers/TelescopeServiceProvider.php
Normal file
64
app/Providers/TelescopeServiceProvider.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Telescope\IncomingEntry;
|
||||
use Laravel\Telescope\Telescope;
|
||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
||||
|
||||
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
// Telescope::night();
|
||||
|
||||
$this->hideSensitiveRequestDetails();
|
||||
|
||||
$isLocal = $this->app->environment('local');
|
||||
|
||||
Telescope::filter(function (IncomingEntry $entry) use ($isLocal) {
|
||||
return $isLocal ||
|
||||
$entry->isReportableException() ||
|
||||
$entry->isFailedRequest() ||
|
||||
$entry->isFailedJob() ||
|
||||
$entry->isScheduledTask() ||
|
||||
$entry->hasMonitoredTag();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent sensitive request details from being logged by Telescope.
|
||||
*/
|
||||
protected function hideSensitiveRequestDetails(): void
|
||||
{
|
||||
if ($this->app->environment('local')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Telescope::hideRequestParameters(['_token']);
|
||||
|
||||
Telescope::hideRequestHeaders([
|
||||
'cookie',
|
||||
'x-csrf-token',
|
||||
'x-xsrf-token',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Telescope gate.
|
||||
*
|
||||
* This gate determines who can access Telescope in non-local environments.
|
||||
*/
|
||||
protected function gate(): void
|
||||
{
|
||||
Gate::define('viewTelescope', function ($user) {
|
||||
return in_array($user->email, [
|
||||
//
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
58
app/Services/FileService.php
Normal file
58
app/Services/FileService.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Export\JournalExport;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Subject;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class FileService
|
||||
{
|
||||
public function exportSubjects()
|
||||
{
|
||||
$listSubjects = collect();
|
||||
$student = Auth::user()->userable;
|
||||
$subjects = $student->grade->subjects;
|
||||
$teachers = $student->grade->teachers;
|
||||
|
||||
$teachers->each(function ($teacher) use ($subjects, $listSubjects) {
|
||||
$teacher->subjects->each(function ($subject) use ($subjects, $listSubjects, $teacher) {
|
||||
if ($subjects->contains($subject)) {
|
||||
$listSubjects->push(['subject' => $subject->name, 'teacher' => $teacher->fio]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return Pdf::loadView('subjects.pdf', ['subjects' => $listSubjects])->download('Предметы.pdf');
|
||||
}
|
||||
|
||||
public function exportStudents(Grade $grade)
|
||||
{
|
||||
$excellentStudents = $this->getMinScore($grade, 5);
|
||||
$goodStudents = $this->getMinScore($grade, 4);
|
||||
|
||||
return Pdf::loadView('grades.list-students', [
|
||||
'excellentStudents' => $excellentStudents,
|
||||
'goodStudents' => $goodStudents,
|
||||
])->download('Студенты.pdf');
|
||||
}
|
||||
|
||||
public function getMinScore(Grade $grade, $minScore)
|
||||
{
|
||||
return $grade->students->filter(function ($student) use ($minScore) {
|
||||
return $student->lessons->min('pivot.score') == $minScore;
|
||||
});
|
||||
}
|
||||
|
||||
public function exportJournal(Grade $grade, Subject $subject)
|
||||
{
|
||||
$lessons = $grade->lessons()->where('subject_id', $subject->id)->with('students')->get();
|
||||
$students = $grade->students()->orderBy('last_name')->get();
|
||||
$fileName = $subject->name . '(' . $grade->name . ').xlsx';
|
||||
|
||||
return Excel::download(new JournalExport($lessons, $students), $fileName);
|
||||
}
|
||||
}
|
23
app/Services/GradeService.php
Normal file
23
app/Services/GradeService.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Grade;
|
||||
use App\Models\Teacher;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class GradeService
|
||||
{
|
||||
public function getGrades()
|
||||
{
|
||||
if (Auth::user()->userable_type == Teacher::class) {
|
||||
return Grade::join('grade_teacher', 'grade_teacher.grade_id', '=', 'grades.id')
|
||||
->where('grade_teacher.teacher_id', Auth::user()->userable_id)
|
||||
->filter()
|
||||
->paginate(5)
|
||||
->withQueryString();
|
||||
}
|
||||
|
||||
return Grade::filter()->paginate(5)->withQueryString();
|
||||
}
|
||||
}
|
19
app/Services/JournalService.php
Normal file
19
app/Services/JournalService.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Grade;
|
||||
use App\Models\Subject;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class JournalService
|
||||
{
|
||||
public function getLessons(Grade $grade, Subject $subject)
|
||||
{
|
||||
return DB::table('lessons')
|
||||
->where('grade_id', $grade->id)
|
||||
->where('subject_id', $subject->id)
|
||||
->orderBy('lesson_date')
|
||||
->get();
|
||||
}
|
||||
}
|
23
app/Services/LessonService.php
Normal file
23
app/Services/LessonService.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Grade;
|
||||
use App\Models\Teacher;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LessonService
|
||||
{
|
||||
public function getLessons(Grade $grade)
|
||||
{
|
||||
if (Auth::user()->userable_type == Teacher::class) {
|
||||
return $grade
|
||||
->lessons()
|
||||
->where('teacher_id', Auth::user()->userable_id)
|
||||
->filter()
|
||||
->get();
|
||||
}
|
||||
|
||||
return $grade->lessons()->filter()->get();
|
||||
}
|
||||
}
|
19
app/Services/ScoreService.php
Normal file
19
app/Services/ScoreService.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Lesson;
|
||||
|
||||
class ScoreService
|
||||
{
|
||||
public function update(Lesson $lesson, array $data)
|
||||
{
|
||||
$lesson->students->each(function ($item, $key) use ($data, $lesson) {
|
||||
if ($data['score' . $item->id]) {
|
||||
$lesson->students()->syncWithoutDetaching([$item->id => ['score' => $data['score' . $item->id]]]);
|
||||
}
|
||||
});
|
||||
|
||||
return $lesson;
|
||||
}
|
||||
}
|
100
app/Services/StudentService.php
Normal file
100
app/Services/StudentService.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Enums\ScoreEnum;
|
||||
use App\Models\Student;
|
||||
use App\Models\Subject;
|
||||
use App\Models\User;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class StudentService
|
||||
{
|
||||
public function create(array $data): Student
|
||||
{
|
||||
$user = User::create([
|
||||
'email' => $data['email'],
|
||||
'password' => $data['password'],
|
||||
]);
|
||||
$student = Student::create([
|
||||
'name' => $data['name'],
|
||||
'last_name' => $data['last_name'],
|
||||
'middle_name' => $data['middle_name'],
|
||||
'birthday' => $data['birthday'],
|
||||
'grade_id' => $data['grade_id'],
|
||||
]);
|
||||
$student->user()->save($user);
|
||||
$student
|
||||
->lessons()
|
||||
->syncWithPivotValues($student->grade->lessons->pluck('id')->all(), ['score' => ScoreEnum::WithoutScore]);
|
||||
|
||||
return $student;
|
||||
}
|
||||
|
||||
public function update(Student $student, array $data): Student
|
||||
{
|
||||
$student->user()->update([
|
||||
'email' => $data['email'],
|
||||
'password' => $data['password'],
|
||||
]);
|
||||
|
||||
$student->update([
|
||||
'name' => $data['name'],
|
||||
'last_name' => $data['last_name'],
|
||||
'middle_name' => $data['middle_name'],
|
||||
'birthday' => $data['birthday'],
|
||||
'grade_id' => $data['grade_id'],
|
||||
]);
|
||||
|
||||
return $student;
|
||||
}
|
||||
|
||||
public function delete($model): void
|
||||
{
|
||||
$model->user()->delete();
|
||||
$model->delete();
|
||||
}
|
||||
|
||||
public function getScores(Subject $subject): Collection
|
||||
{
|
||||
$student = Auth::user()->userable;
|
||||
|
||||
return $student->lessons()->where('subject_id', $subject->id)->get();
|
||||
}
|
||||
|
||||
public function getAvgScore(Subject $subject)
|
||||
{
|
||||
$student = Auth::user()->userable;
|
||||
$scores = $student
|
||||
->lessons()
|
||||
->where('subject_id', $subject->id)
|
||||
->whereIn('score', ScoreEnum::getNumScores())
|
||||
->pluck('score');
|
||||
|
||||
return round($scores->avg(), 2);
|
||||
}
|
||||
|
||||
public function getDebts(): Collection
|
||||
{
|
||||
$student = Auth::user()->userable;
|
||||
|
||||
return $student->lessons()->whereIn('score', ScoreEnum::getDebtScores())->get();
|
||||
}
|
||||
|
||||
public function exportAvgScores()
|
||||
{
|
||||
$subjects = Auth::user()->userable->grade->subjects;
|
||||
$avgScores = collect();
|
||||
|
||||
$subjects->each(function ($subject) use ($avgScores) {
|
||||
$avgScores->put($subject->name, $this->getAvgScore($subject));
|
||||
});
|
||||
|
||||
return Pdf::loadView('students.avg-scores', [
|
||||
'avgScores' => $avgScores,
|
||||
])->download('Успеваемость.pdf');
|
||||
}
|
||||
}
|
22
app/Services/SubjectService.php
Normal file
22
app/Services/SubjectService.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Student;
|
||||
use App\Models\Subject;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SubjectService
|
||||
{
|
||||
public function getSubjects()
|
||||
{
|
||||
if(Auth::user()->userable_type == Student::class) {
|
||||
return Subject::whereIn('id', Auth::user()->userable->grade->subjects->pluck('id'))
|
||||
->filter()
|
||||
->paginate(5)
|
||||
->withQueryString();
|
||||
}
|
||||
|
||||
return Subject::filter()->paginate(5)->withQueryString();
|
||||
}
|
||||
}
|
79
app/Services/TeacherService.php
Normal file
79
app/Services/TeacherService.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Student;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Teacher;
|
||||
use App\Models\User;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class TeacherService
|
||||
{
|
||||
public function create(array $data): Teacher
|
||||
{
|
||||
$user = User::create([
|
||||
'email' => $data['email'],
|
||||
'password' => $data['password'],
|
||||
]);
|
||||
$teacher = Teacher::create([
|
||||
'name' => $data['name'],
|
||||
'last_name' => $data['last_name'],
|
||||
'middle_name' => $data['middle_name'],
|
||||
'birthday' => $data['birthday'],
|
||||
]);
|
||||
$teacher->user()->save($user);
|
||||
|
||||
return $teacher;
|
||||
}
|
||||
|
||||
public function update(Teacher $teacher, array $data): Teacher
|
||||
{
|
||||
$teacher->user()->update([
|
||||
'email' => $data['email'],
|
||||
'password' => $data['password'],
|
||||
]);
|
||||
|
||||
$teacher->update([
|
||||
'name' => $data['name'],
|
||||
'last_name' => $data['last_name'],
|
||||
'middle_name' => $data['middle_name'],
|
||||
'birthday' => $data['birthday'],
|
||||
]);
|
||||
|
||||
return $teacher;
|
||||
}
|
||||
|
||||
public function delete(Teacher $teacher): void
|
||||
{
|
||||
$teacher->user()->delete();
|
||||
$teacher->delete();
|
||||
}
|
||||
|
||||
public function getTeachers()
|
||||
{
|
||||
if (Auth::user()->userable_type == Student::class) {
|
||||
return Teacher::join('grade_teacher', 'teachers.id', '=', 'grade_teacher.teacher_id')
|
||||
->where('grade_id', Auth::user()->userable->grade_id)
|
||||
->filter()
|
||||
->paginate(5)
|
||||
->withQueryString();
|
||||
}
|
||||
|
||||
return Teacher::filter()->paginate(5)->withQueryString();
|
||||
}
|
||||
|
||||
public function getSubjects(Teacher $teacher)
|
||||
{
|
||||
if (Auth::user()->userable_type == Student::class) {
|
||||
return Subject::join('subject_teacher', 'subject_teacher.subject_id', '=', 'subjects.id')
|
||||
->join('grade_subject', 'grade_subject.subject_id', '=', 'subjects.id')
|
||||
->where('grade_subject.grade_id', Auth::user()->userable->grade_id)
|
||||
->where('subject_teacher.teacher_id', $teacher->id)
|
||||
->get();
|
||||
}
|
||||
|
||||
return $teacher->subjects;
|
||||
}
|
||||
}
|
17
app/View/Components/AppLayout.php
Normal file
17
app/View/Components/AppLayout.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class AppLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*/
|
||||
public function render(): View
|
||||
{
|
||||
return view('layouts.app');
|
||||
}
|
||||
}
|
17
app/View/Components/GuestLayout.php
Normal file
17
app/View/Components/GuestLayout.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class GuestLayout extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represents the component.
|
||||
*/
|
||||
public function render(): View
|
||||
{
|
||||
return view('layouts.guest');
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
//
|
||||
$middleware->redirectGuestsTo('/login');
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
|
@ -2,4 +2,5 @@
|
||||
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\TelescopeServiceProvider::class,
|
||||
];
|
||||
|
@ -6,12 +6,17 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"barryvdh/laravel-dompdf": "^2.2",
|
||||
"laravel/framework": "^11.0",
|
||||
"laravel/telescope": "^5.0",
|
||||
"laravel/tinker": "^2.9",
|
||||
"laravel/ui": "^4.5"
|
||||
"laravel/ui": "^4.5",
|
||||
"maatwebsite/excel": "^3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel-lang/lang": "^15.5",
|
||||
"laravel/breeze": "^2.0",
|
||||
"laravel/pint": "^1.13",
|
||||
"laravel/sail": "^1.26",
|
||||
"mockery/mockery": "^1.6",
|
||||
|
1946
composer.lock
generated
1946
composer.lock
generated
File diff suppressed because it is too large
Load Diff
284
config/dompdf.php
Normal file
284
config/dompdf.php
Normal file
@ -0,0 +1,284 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set some default values. It is possible to add all defines that can be set
|
||||
| in dompdf_config.inc.php. You can also override the entire config file.
|
||||
|
|
||||
*/
|
||||
'show_warnings' => false, // Throw an Exception on warnings from dompdf
|
||||
|
||||
'public_path' => null, // Override the public path if needed
|
||||
|
||||
/*
|
||||
* Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £.
|
||||
*/
|
||||
'convert_entities' => true,
|
||||
|
||||
'options' => array(
|
||||
/**
|
||||
* The location of the DOMPDF font directory
|
||||
*
|
||||
* The location of the directory where DOMPDF will store fonts and font metrics
|
||||
* Note: This directory must exist and be writable by the webserver process.
|
||||
* *Please note the trailing slash.*
|
||||
*
|
||||
* Notes regarding fonts:
|
||||
* Additional .afm font metrics can be added by executing load_font.php from command line.
|
||||
*
|
||||
* Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
|
||||
* be embedded in the pdf file or the PDF may not display correctly. This can significantly
|
||||
* increase file size unless font subsetting is enabled. Before embedding a font please
|
||||
* review your rights under the font license.
|
||||
*
|
||||
* Any font specification in the source HTML is translated to the closest font available
|
||||
* in the font directory.
|
||||
*
|
||||
* The pdf standard "Base 14 fonts" are:
|
||||
* Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
|
||||
* Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
|
||||
* Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
|
||||
* Symbol, ZapfDingbats.
|
||||
*/
|
||||
"font_dir" => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
|
||||
|
||||
/**
|
||||
* The location of the DOMPDF font cache directory
|
||||
*
|
||||
* This directory contains the cached font metrics for the fonts used by DOMPDF.
|
||||
* This directory can be the same as DOMPDF_FONT_DIR
|
||||
*
|
||||
* Note: This directory must exist and be writable by the webserver process.
|
||||
*/
|
||||
"font_cache" => storage_path('fonts'),
|
||||
|
||||
/**
|
||||
* The location of a temporary directory.
|
||||
*
|
||||
* The directory specified must be writeable by the webserver process.
|
||||
* The temporary directory is required to download remote images and when
|
||||
* using the PDFLib back end.
|
||||
*/
|
||||
"temp_dir" => sys_get_temp_dir(),
|
||||
|
||||
/**
|
||||
* ==== IMPORTANT ====
|
||||
*
|
||||
* dompdf's "chroot": Prevents dompdf from accessing system files or other
|
||||
* files on the webserver. All local files opened by dompdf must be in a
|
||||
* subdirectory of this directory. DO NOT set it to '/' since this could
|
||||
* allow an attacker to use dompdf to read any files on the server. This
|
||||
* should be an absolute path.
|
||||
* This is only checked on command line call by dompdf.php, but not by
|
||||
* direct class use like:
|
||||
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
|
||||
*/
|
||||
"chroot" => realpath(base_path()),
|
||||
|
||||
/**
|
||||
* Protocol whitelist
|
||||
*
|
||||
* Protocols and PHP wrappers allowed in URIs, and the validation rules
|
||||
* that determine if a resouce may be loaded. Full support is not guaranteed
|
||||
* for the protocols/wrappers specified
|
||||
* by this array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
'allowed_protocols' => [
|
||||
"file://" => ["rules" => []],
|
||||
"http://" => ["rules" => []],
|
||||
"https://" => ["rules" => []]
|
||||
],
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
'log_output_file' => null,
|
||||
|
||||
/**
|
||||
* Whether to enable font subsetting or not.
|
||||
*/
|
||||
"enable_font_subsetting" => false,
|
||||
|
||||
/**
|
||||
* The PDF rendering backend to use
|
||||
*
|
||||
* Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
|
||||
* 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
|
||||
* fall back on CPDF. 'GD' renders PDFs to graphic files. {@link
|
||||
* Canvas_Factory} ultimately determines which rendering class to instantiate
|
||||
* based on this setting.
|
||||
*
|
||||
* Both PDFLib & CPDF rendering backends provide sufficient rendering
|
||||
* capabilities for dompdf, however additional features (e.g. object,
|
||||
* image and font support, etc.) differ between backends. Please see
|
||||
* {@link PDFLib_Adapter} for more information on the PDFLib backend
|
||||
* and {@link CPDF_Adapter} and lib/class.pdf.php for more information
|
||||
* on CPDF. Also see the documentation for each backend at the links
|
||||
* below.
|
||||
*
|
||||
* The GD rendering backend is a little different than PDFLib and
|
||||
* CPDF. Several features of CPDF and PDFLib are not supported or do
|
||||
* not make any sense when creating image files. For example,
|
||||
* multiple pages are not supported, nor are PDF 'objects'. Have a
|
||||
* look at {@link GD_Adapter} for more information. GD support is
|
||||
* experimental, so use it at your own risk.
|
||||
*
|
||||
* @link http://www.pdflib.com
|
||||
* @link http://www.ros.co.nz/pdf
|
||||
* @link http://www.php.net/image
|
||||
*/
|
||||
"pdf_backend" => "CPDF",
|
||||
|
||||
/**
|
||||
* PDFlib license key
|
||||
*
|
||||
* If you are using a licensed, commercial version of PDFlib, specify
|
||||
* your license key here. If you are using PDFlib-Lite or are evaluating
|
||||
* the commercial version of PDFlib, comment out this setting.
|
||||
*
|
||||
* @link http://www.pdflib.com
|
||||
*
|
||||
* If pdflib present in web server and auto or selected explicitely above,
|
||||
* a real license code must exist!
|
||||
*/
|
||||
//"DOMPDF_PDFLIB_LICENSE" => "your license key here",
|
||||
|
||||
/**
|
||||
* html target media view which should be rendered into pdf.
|
||||
* List of types and parsing rules for future extensions:
|
||||
* http://www.w3.org/TR/REC-html40/types.html
|
||||
* screen, tty, tv, projection, handheld, print, braille, aural, all
|
||||
* Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
|
||||
* Note, even though the generated pdf file is intended for print output,
|
||||
* the desired content might be different (e.g. screen or projection view of html file).
|
||||
* Therefore allow specification of content here.
|
||||
*/
|
||||
"default_media_type" => "screen",
|
||||
|
||||
/**
|
||||
* The default paper size.
|
||||
*
|
||||
* North America standard is "letter"; other countries generally "a4"
|
||||
*
|
||||
* @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
|
||||
*/
|
||||
"default_paper_size" => "a4",
|
||||
|
||||
/**
|
||||
* The default paper orientation.
|
||||
*
|
||||
* The orientation of the page (portrait or landscape).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
'default_paper_orientation' => "portrait",
|
||||
|
||||
/**
|
||||
* The default font family
|
||||
*
|
||||
* Used if no suitable fonts can be found. This must exist in the font folder.
|
||||
* @var string
|
||||
*/
|
||||
"default_font" => "serif",
|
||||
|
||||
/**
|
||||
* Image DPI setting
|
||||
*
|
||||
* This setting determines the default DPI setting for images and fonts. The
|
||||
* DPI may be overridden for inline images by explictly setting the
|
||||
* image's width & height style attributes (i.e. if the image's native
|
||||
* width is 600 pixels and you specify the image's width as 72 points,
|
||||
* the image will have a DPI of 600 in the rendered PDF. The DPI of
|
||||
* background images can not be overridden and is controlled entirely
|
||||
* via this parameter.
|
||||
*
|
||||
* For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
|
||||
* If a size in html is given as px (or without unit as image size),
|
||||
* this tells the corresponding size in pt.
|
||||
* This adjusts the relative sizes to be similar to the rendering of the
|
||||
* html page in a reference browser.
|
||||
*
|
||||
* In pdf, always 1 pt = 1/72 inch
|
||||
*
|
||||
* Rendering resolution of various browsers in px per inch:
|
||||
* Windows Firefox and Internet Explorer:
|
||||
* SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
|
||||
* Linux Firefox:
|
||||
* about:config *resolution: Default:96
|
||||
* (xorg screen dimension in mm and Desktop font dpi settings are ignored)
|
||||
*
|
||||
* Take care about extra font/image zoom factor of browser.
|
||||
*
|
||||
* In images, <img> size in pixel attribute, img css style, are overriding
|
||||
* the real image dimension in px for rendering.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
"dpi" => 96,
|
||||
|
||||
/**
|
||||
* Enable inline PHP
|
||||
*
|
||||
* If this setting is set to true then DOMPDF will automatically evaluate
|
||||
* inline PHP contained within <script type="text/php"> ... </script> tags.
|
||||
*
|
||||
* Enabling this for documents you do not trust (e.g. arbitrary remote html
|
||||
* pages) is a security risk. Set this option to false if you wish to process
|
||||
* untrusted documents.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
"enable_php" => false,
|
||||
|
||||
/**
|
||||
* Enable inline Javascript
|
||||
*
|
||||
* If this setting is set to true then DOMPDF will automatically insert
|
||||
* JavaScript code contained within <script type="text/javascript"> ... </script> tags.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
"enable_javascript" => true,
|
||||
|
||||
/**
|
||||
* Enable remote file access
|
||||
*
|
||||
* If this setting is set to true, DOMPDF will access remote sites for
|
||||
* images and CSS files as required.
|
||||
* This is required for part of test case www/test/image_variants.html through www/examples.php
|
||||
*
|
||||
* Attention!
|
||||
* This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and
|
||||
* allowing remote access to dompdf.php or on allowing remote html code to be passed to
|
||||
* $dompdf = new DOMPDF(, $dompdf->load_html(...,
|
||||
* This allows anonymous users to download legally doubtful internet content which on
|
||||
* tracing back appears to being downloaded by your server, or allows malicious php code
|
||||
* in remote html pages to be executed by your server with your account privileges.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
"enable_remote" => true,
|
||||
|
||||
/**
|
||||
* A ratio applied to the fonts height to be more like browsers' line height
|
||||
*/
|
||||
"font_height_ratio" => 1.1,
|
||||
|
||||
/**
|
||||
* Use the HTML5 Lib parser
|
||||
*
|
||||
* @deprecated This feature is now always on in dompdf 2.x
|
||||
* @var bool
|
||||
*/
|
||||
"enable_html5_parser" => true,
|
||||
),
|
||||
|
||||
|
||||
);
|
379
config/excel.php
Normal file
379
config/excel.php
Normal file
@ -0,0 +1,379 @@
|
||||
<?php
|
||||
|
||||
use Maatwebsite\Excel\Excel;
|
||||
|
||||
return [
|
||||
'exports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Chunk size
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using FromQuery, the query is automatically chunked.
|
||||
| Here you can specify how big the chunk should be.
|
||||
|
|
||||
*/
|
||||
'chunk_size' => 1000,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pre-calculate formulas during export
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'pre_calculate_formulas' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable strict null comparison
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When enabling strict null comparison empty cells ('') will
|
||||
| be added to the sheet.
|
||||
*/
|
||||
'strict_null_comparison' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'line_ending' => PHP_EOL,
|
||||
'use_bom' => false,
|
||||
'include_separator_line' => false,
|
||||
'excel_compatibility' => false,
|
||||
'output_encoding' => '',
|
||||
'test_auto_detect' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
],
|
||||
|
||||
'imports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Read Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might only be interested in the
|
||||
| data that the sheet exists. By default we ignore all styles,
|
||||
| however if you want to do some logic based on style data
|
||||
| you can enable it by setting read_only to false.
|
||||
|
|
||||
*/
|
||||
'read_only' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignore Empty
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might be interested in ignoring
|
||||
| rows that have null values or empty strings. By default rows
|
||||
| containing empty strings or empty values are not ignored but can be
|
||||
| ignored by enabling the setting ignore_empty to true.
|
||||
|
|
||||
*/
|
||||
'ignore_empty' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading Row Formatter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure the heading row formatter.
|
||||
| Available options: none|slug|custom
|
||||
|
|
||||
*/
|
||||
'heading_row' => [
|
||||
'formatter' => 'slug',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => null,
|
||||
'enclosure' => '"',
|
||||
'escape_character' => '\\',
|
||||
'contiguous' => false,
|
||||
'input_encoding' => 'UTF-8',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cell Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure middleware that is executed on getting a cell value
|
||||
|
|
||||
*/
|
||||
'cells' => [
|
||||
'middleware' => [
|
||||
//\Maatwebsite\Excel\Middleware\TrimCellValue::class,
|
||||
//\Maatwebsite\Excel\Middleware\ConvertEmptyCellValuesToNull::class,
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extension detector
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which writer/reader type should be used when the package
|
||||
| needs to guess the correct type based on the extension alone.
|
||||
|
|
||||
*/
|
||||
'extension_detector' => [
|
||||
'xlsx' => Excel::XLSX,
|
||||
'xlsm' => Excel::XLSX,
|
||||
'xltx' => Excel::XLSX,
|
||||
'xltm' => Excel::XLSX,
|
||||
'xls' => Excel::XLS,
|
||||
'xlt' => Excel::XLS,
|
||||
'ods' => Excel::ODS,
|
||||
'ots' => Excel::ODS,
|
||||
'slk' => Excel::SLK,
|
||||
'xml' => Excel::XML,
|
||||
'gnumeric' => Excel::GNUMERIC,
|
||||
'htm' => Excel::HTML,
|
||||
'html' => Excel::HTML,
|
||||
'csv' => Excel::CSV,
|
||||
'tsv' => Excel::TSV,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDF Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which Pdf driver should be used by default.
|
||||
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
||||
|
|
||||
*/
|
||||
'pdf' => Excel::DOMPDF,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Value Binder
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| PhpSpreadsheet offers a way to hook into the process of a value being
|
||||
| written to a cell. In there some assumptions are made on how the
|
||||
| value should be formatted. If you want to change those defaults,
|
||||
| you can implement your own default value binder.
|
||||
|
|
||||
| Possible value binders:
|
||||
|
|
||||
| [x] Maatwebsite\Excel\DefaultValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
||||
|
|
||||
*/
|
||||
'value_binder' => [
|
||||
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default cell caching driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default PhpSpreadsheet keeps all cell values in memory, however when
|
||||
| dealing with large files, this might result into memory issues. If you
|
||||
| want to mitigate that, you can configure a cell caching driver here.
|
||||
| When using the illuminate driver, it will store each value in the
|
||||
| cache store. This can slow down the process, because it needs to
|
||||
| store each value. You can use the "batch" store if you want to
|
||||
| only persist to the store when the memory limit is reached.
|
||||
|
|
||||
| Drivers: memory|illuminate|batch
|
||||
|
|
||||
*/
|
||||
'driver' => 'memory',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Batch memory caching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with the "batch" caching driver, it will only
|
||||
| persist to the store when the memory limit is reached.
|
||||
| Here you can tweak the memory limit to your liking.
|
||||
|
|
||||
*/
|
||||
'batch' => [
|
||||
'memory_limit' => 60000,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Illuminate cache
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "illuminate" caching driver, it will automatically use
|
||||
| your default cache store. However if you prefer to have the cell
|
||||
| cache on a separate store, you can configure the store name here.
|
||||
| You can use any store defined in your cache config. When leaving
|
||||
| at "null" it will use the default store.
|
||||
|
|
||||
*/
|
||||
'illuminate' => [
|
||||
'store' => null,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Time-to-live (TTL)
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The TTL of items written to cache. If you want to keep the items cached
|
||||
| indefinitely, set this to null. Otherwise, set a number of seconds,
|
||||
| a \DateInterval, or a callable.
|
||||
|
|
||||
| Allowable types: callable|\DateInterval|int|null
|
||||
|
|
||||
*/
|
||||
'default_ttl' => 10800,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Transaction Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default the import is wrapped in a transaction. This is useful
|
||||
| for when an import may fail and you want to retry it. With the
|
||||
| transactions, the previous import gets rolled-back.
|
||||
|
|
||||
| You can disable the transaction handler by setting this to null.
|
||||
| Or you can choose a custom made transaction handler here.
|
||||
|
|
||||
| Supported handlers: null|db
|
||||
|
|
||||
*/
|
||||
'transactions' => [
|
||||
'handler' => 'db',
|
||||
'db' => [
|
||||
'connection' => null,
|
||||
],
|
||||
],
|
||||
|
||||
'temporary_files' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Local Temporary Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When exporting and importing files, we use a temporary file, before
|
||||
| storing reading or downloading. Here you can customize that path.
|
||||
| permissions is an array with the permission flags for the directory (dir)
|
||||
| and the create file (file).
|
||||
|
|
||||
*/
|
||||
'local_path' => storage_path('framework/cache/laravel-excel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Local Temporary Path Permissions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Permissions is an array with the permission flags for the directory (dir)
|
||||
| and the create file (file).
|
||||
| If omitted the default permissions of the filesystem will be used.
|
||||
|
|
||||
*/
|
||||
'local_permissions' => [
|
||||
// 'dir' => 0755,
|
||||
// 'file' => 0644,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Temporary Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup with queues in which you
|
||||
| cannot rely on having a shared local temporary path, you might
|
||||
| want to store the temporary file on a shared disk. During the
|
||||
| queue executing, we'll retrieve the temporary file from that
|
||||
| location instead. When left to null, it will always use
|
||||
| the local path. This setting only has effect when using
|
||||
| in conjunction with queued imports and exports.
|
||||
|
|
||||
*/
|
||||
'remote_disk' => null,
|
||||
'remote_prefix' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Force Resync
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup as above, it's possible
|
||||
| for the clean up that occurs after entire queue has been run to only
|
||||
| cleanup the server that the last AfterImportJob runs on. The rest of the server
|
||||
| would still have the local temporary file stored on it. In this case your
|
||||
| local storage limits can be exceeded and future imports won't be processed.
|
||||
| To mitigate this you can set this config value to be true, so that after every
|
||||
| queued chunk is processed the local temporary file is deleted on the server that
|
||||
| processed it.
|
||||
|
|
||||
*/
|
||||
'force_resync_remote' => null,
|
||||
],
|
||||
];
|
205
config/telescope.php
Normal file
205
config/telescope.php
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
|
||||
use Laravel\Telescope\Http\Middleware\Authorize;
|
||||
use Laravel\Telescope\Watchers;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Master Switch
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option may be used to disable all Telescope watchers regardless
|
||||
| of their individual configuration, which simply provides a single
|
||||
| and convenient way to enable or disable Telescope data storage.
|
||||
|
|
||||
*/
|
||||
|
||||
'enabled' => env('TELESCOPE_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the subdomain where Telescope will be accessible from. If the
|
||||
| setting is null, Telescope will reside under the same domain as the
|
||||
| application. Otherwise, this value will be used as the subdomain.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('TELESCOPE_DOMAIN'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the URI path where Telescope will be accessible from. Feel free
|
||||
| to change this path to anything you like. Note that the URI will not
|
||||
| affect the paths of its internal API that aren't exposed to users.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => env('TELESCOPE_PATH', 'telescope'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Storage Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration options determines the storage driver that will
|
||||
| be used to store Telescope's data. In addition, you may set any
|
||||
| custom options as needed by the particular driver you choose.
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('TELESCOPE_DRIVER', 'database'),
|
||||
|
||||
'storage' => [
|
||||
'database' => [
|
||||
'connection' => env('DB_CONNECTION', 'mysql'),
|
||||
'chunk' => 1000,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Queue
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration options determines the queue connection and queue
|
||||
| which will be used to process ProcessPendingUpdate jobs. This can
|
||||
| be changed if you would prefer to use a non-default connection.
|
||||
|
|
||||
*/
|
||||
|
||||
'queue' => [
|
||||
'connection' => env('TELESCOPE_QUEUE_CONNECTION', null),
|
||||
'queue' => env('TELESCOPE_QUEUE', null),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Route Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These middleware will be assigned to every Telescope route, giving you
|
||||
| the chance to add your own middleware to this list or change any of
|
||||
| the existing middleware. Or, you can simply stick with this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'web',
|
||||
Authorize::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allowed / Ignored Paths & Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the URI paths and Artisan commands that will
|
||||
| not be watched by Telescope. In addition to this list, some Laravel
|
||||
| commands, like migrations and queue commands, are always ignored.
|
||||
|
|
||||
*/
|
||||
|
||||
'only_paths' => [
|
||||
// 'api/*'
|
||||
],
|
||||
|
||||
'ignore_paths' => [
|
||||
'livewire*',
|
||||
'nova-api*',
|
||||
'pulse*',
|
||||
],
|
||||
|
||||
'ignore_commands' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Watchers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the "watchers" that will be registered with
|
||||
| Telescope. The watchers gather the application's profile data when
|
||||
| a request or task is executed. Feel free to customize this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'watchers' => [
|
||||
Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true),
|
||||
|
||||
Watchers\CacheWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_CACHE_WATCHER', true),
|
||||
'hidden' => [],
|
||||
],
|
||||
|
||||
Watchers\ClientRequestWatcher::class => env('TELESCOPE_CLIENT_REQUEST_WATCHER', true),
|
||||
|
||||
Watchers\CommandWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_COMMAND_WATCHER', true),
|
||||
'ignore' => [],
|
||||
],
|
||||
|
||||
Watchers\DumpWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_DUMP_WATCHER', true),
|
||||
'always' => env('TELESCOPE_DUMP_WATCHER_ALWAYS', false),
|
||||
],
|
||||
|
||||
Watchers\EventWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_EVENT_WATCHER', true),
|
||||
'ignore' => [],
|
||||
],
|
||||
|
||||
Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true),
|
||||
|
||||
Watchers\GateWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_GATE_WATCHER', true),
|
||||
'ignore_abilities' => [],
|
||||
'ignore_packages' => true,
|
||||
'ignore_paths' => [],
|
||||
],
|
||||
|
||||
Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
|
||||
|
||||
Watchers\LogWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_LOG_WATCHER', true),
|
||||
'level' => 'error',
|
||||
],
|
||||
|
||||
Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true),
|
||||
|
||||
Watchers\ModelWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_MODEL_WATCHER', true),
|
||||
'events' => ['eloquent.*'],
|
||||
'hydrations' => true,
|
||||
],
|
||||
|
||||
Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true),
|
||||
|
||||
Watchers\QueryWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
|
||||
'ignore_packages' => true,
|
||||
'ignore_paths' => [],
|
||||
'slow' => 100,
|
||||
],
|
||||
|
||||
Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true),
|
||||
|
||||
Watchers\RequestWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_REQUEST_WATCHER', true),
|
||||
'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64),
|
||||
'ignore_http_methods' => [],
|
||||
'ignore_status_codes' => [],
|
||||
],
|
||||
|
||||
Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true),
|
||||
Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true),
|
||||
],
|
||||
];
|
51
config/tinker.php
Normal file
51
config/tinker.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Console Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to add additional Artisan commands that should
|
||||
| be available within the Tinker environment. Once the command is in
|
||||
| this array you may execute the command in Tinker using its name.
|
||||
|
|
||||
*/
|
||||
|
||||
'commands' => [
|
||||
App\Console\Commands\AddAdmin::class,
|
||||
App\Console\Commands\AddScores::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto Aliased Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Tinker will not automatically alias classes in your vendor namespaces
|
||||
| but you may explicitly allow a subset of classes to get aliased by
|
||||
| adding the names of each of those classes to the following list.
|
||||
|
|
||||
*/
|
||||
|
||||
'alias' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Classes That Should Not Be Aliased
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Typically, Tinker automatically aliases classes as you require them in
|
||||
| Tinker. However, you may wish to never alias certain classes, which
|
||||
| you may accomplish by listing the classes in the following array.
|
||||
|
|
||||
*/
|
||||
|
||||
'dont_alias' => [
|
||||
'App\Nova',
|
||||
],
|
||||
|
||||
];
|
23
database/factories/GradeFactory.php
Normal file
23
database/factories/GradeFactory.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Grade>
|
||||
*/
|
||||
class GradeFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'Класс' . fake()->unique()->numberBetween(1,100)
|
||||
];
|
||||
}
|
||||
}
|
29
database/factories/LessonFactory.php
Normal file
29
database/factories/LessonFactory.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\TypeLesson;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Lesson>
|
||||
*/
|
||||
class LessonFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$typeLessonCases = TypeLesson::cases();
|
||||
|
||||
return [
|
||||
'name' => 'Занятие' . fake()->unique()->numberBetween(),
|
||||
'description' => fake()->text(200),
|
||||
'type' => $typeLessonCases[array_rand($typeLessonCases)],
|
||||
'lesson_date' => fake()->date(),
|
||||
];
|
||||
}
|
||||
}
|
26
database/factories/StudentFactory.php
Normal file
26
database/factories/StudentFactory.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Student>
|
||||
*/
|
||||
class StudentFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->firstNameMale,
|
||||
'last_name' => fake()->lastNameMale,
|
||||
'middle_name' => fake()->middleNameMale,
|
||||
'birthday' => fake()->date(),
|
||||
];
|
||||
}
|
||||
}
|
23
database/factories/SubjectFactory.php
Normal file
23
database/factories/SubjectFactory.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Subject>
|
||||
*/
|
||||
class SubjectFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'Предмет' . fake()->unique()->numberBetween(1, 100)
|
||||
];
|
||||
}
|
||||
}
|
26
database/factories/TeacherFactory.php
Normal file
26
database/factories/TeacherFactory.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Teacher>
|
||||
*/
|
||||
class TeacherFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->firstNameMale,
|
||||
'last_name' => fake()->lastNameMale,
|
||||
'middle_name' => fake()->middleNameMale,
|
||||
'birthday' => fake()->date(),
|
||||
];
|
||||
}
|
||||
}
|
@ -24,7 +24,6 @@ class UserFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
|
@ -13,10 +13,10 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->nullableMorphs('userable');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
@ -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('subjects', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('subjects');
|
||||
}
|
||||
};
|
@ -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('grade_subject', function (Blueprint $table) {
|
||||
$table->foreignId('grade_id')->constrained('grades')->onDelete('cascade');
|
||||
$table->foreignId('subject_id')->constrained('subjects')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('grade_subject');
|
||||
}
|
||||
};
|
@ -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('teachers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('last_name');
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->date('birthday');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('teachers');
|
||||
}
|
||||
};
|
@ -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('students', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('last_name');
|
||||
$table->string('middle_name')->nullable();
|
||||
$table->date('birthday');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('students');
|
||||
}
|
||||
};
|
@ -0,0 +1,27 @@
|
||||
<?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('admins', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('admins');
|
||||
}
|
||||
};
|
@ -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('subject_teacher', function (Blueprint $table) {
|
||||
$table->foreignId('subject_id')->constrained('subjects')->onDelete('cascade');
|
||||
$table->foreignId('teacher_id')->constrained('teachers')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('subject_teacher');
|
||||
}
|
||||
};
|
@ -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('grade_teacher', function (Blueprint $table) {
|
||||
$table->foreignId('grade_id')->constrained('grades')->onDelete('cascade');
|
||||
$table->foreignId('teacher_id')->constrained('teachers')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('grade_teacher');
|
||||
}
|
||||
};
|
@ -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::table('students', function (Blueprint $table) {
|
||||
$table->foreignId('grade_id')->constrained('grades')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('students', function (Blueprint $table) {
|
||||
$table->dropColumn('grade_id');
|
||||
});
|
||||
}
|
||||
};
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Get the migration connection name.
|
||||
*/
|
||||
public function getConnection(): ?string
|
||||
{
|
||||
return config('telescope.storage.database.connection');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$schema = Schema::connection($this->getConnection());
|
||||
|
||||
$schema->create('telescope_entries', function (Blueprint $table) {
|
||||
$table->bigIncrements('sequence');
|
||||
$table->uuid('uuid');
|
||||
$table->uuid('batch_id');
|
||||
$table->string('family_hash')->nullable();
|
||||
$table->boolean('should_display_on_index')->default(true);
|
||||
$table->string('type', 20);
|
||||
$table->longText('content');
|
||||
$table->dateTime('created_at')->nullable();
|
||||
|
||||
$table->unique('uuid');
|
||||
$table->index('batch_id');
|
||||
$table->index('family_hash');
|
||||
$table->index('created_at');
|
||||
$table->index(['type', 'should_display_on_index']);
|
||||
});
|
||||
|
||||
$schema->create('telescope_entries_tags', function (Blueprint $table) {
|
||||
$table->uuid('entry_uuid');
|
||||
$table->string('tag');
|
||||
|
||||
$table->primary(['entry_uuid', 'tag']);
|
||||
$table->index('tag');
|
||||
|
||||
$table->foreign('entry_uuid')
|
||||
->references('uuid')
|
||||
->on('telescope_entries')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
$schema->create('telescope_monitoring', function (Blueprint $table) {
|
||||
$table->string('tag')->primary();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$schema = Schema::connection($this->getConnection());
|
||||
|
||||
$schema->dropIfExists('telescope_entries_tags');
|
||||
$schema->dropIfExists('telescope_entries');
|
||||
$schema->dropIfExists('telescope_monitoring');
|
||||
}
|
||||
};
|
@ -0,0 +1,34 @@
|
||||
<?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('lessons', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->string('type');
|
||||
$table->date('lesson_date');
|
||||
$table->foreignId('grade_id')->constrained('grades')->onDelete('cascade');
|
||||
$table->foreignId('subject_id')->constrained('subjects')->onDelete('cascade');
|
||||
$table->foreignId('teacher_id')->constrained('teachers')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('lessons');
|
||||
}
|
||||
};
|
@ -0,0 +1,29 @@
|
||||
<?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('lesson_student', function (Blueprint $table) {
|
||||
$table->foreignId('lesson_id')->constrained('lessons')->onDelete('cascade');
|
||||
$table->foreignId('student_id')->constrained('students')->onDelete('cascade');
|
||||
$table->string('score');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('lesson_student');
|
||||
}
|
||||
};
|
@ -2,8 +2,13 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Enums\ScoreEnum;
|
||||
use App\Models\Grade;
|
||||
use App\Models\Lesson;
|
||||
use App\Models\Student;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Teacher;
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
@ -13,11 +18,85 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
$namesSubjects = [
|
||||
'Русский язык',
|
||||
'Математика',
|
||||
'Английский язык',
|
||||
'Биология',
|
||||
'Химия',
|
||||
'Литература',
|
||||
'География',
|
||||
'История',
|
||||
'Обществознание',
|
||||
'Информатика',
|
||||
];
|
||||
$subjects = collect();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
foreach ($namesSubjects as $name) {
|
||||
$subjects->push(Subject::factory()->create([
|
||||
'name' => $name,
|
||||
]));
|
||||
}
|
||||
|
||||
$letterGrades = ['A', 'Б', 'В',];
|
||||
$numberGrades = 11;
|
||||
$grades = collect();
|
||||
|
||||
while($numberGrades > 0) {
|
||||
foreach ($letterGrades as $letter) {
|
||||
$grades->push(Grade::factory()->create([
|
||||
'name' => $numberGrades . $letter,
|
||||
]));
|
||||
}
|
||||
$numberGrades--;
|
||||
}
|
||||
$teachers = Teacher::factory(15)->create();
|
||||
$scores = ScoreEnum::cases();
|
||||
|
||||
$teachers->each(function ($teacher) {
|
||||
$user = User::factory()->create();
|
||||
$teacher->user()->save($user);
|
||||
});
|
||||
|
||||
$teacher = Teacher::factory()->create();
|
||||
$teacher->user()->save(User::factory()->create(['email' => 'teacher@mail']));
|
||||
$teacher->grades()->attach($grades->pluck('id'));
|
||||
|
||||
$student = Student::factory()->create(['grade_id' => $grades->first()->id]);
|
||||
$student->user()->save(User::factory()->create(['email' => 'student@mail']));
|
||||
|
||||
$grade = $student->grade;
|
||||
|
||||
$lessons = collect();
|
||||
$subjects->each(function ($item) use ($lessons, $teacher, $student, $grade) {
|
||||
$teacher->subjects()->attach($item);
|
||||
$grade->subjects()->attach($item);
|
||||
|
||||
$lessons->push(Lesson::factory(5)->create([
|
||||
'description' => 'Выполнение задания №3 на 87 стр. учебника',
|
||||
'grade_id' => $student->grade_id,
|
||||
'subject_id' => $item->id,
|
||||
'teacher_id' => $teacher->id,
|
||||
]));
|
||||
});
|
||||
|
||||
|
||||
$grades->each(function ($grade) use ($subjects, $teachers, $scores){
|
||||
Student::factory(30)->create([
|
||||
'grade_id' => $grade->id,
|
||||
])->each(function ($student) use ($scores) {
|
||||
$user = User::factory()->create();
|
||||
$student->user()->save($user);
|
||||
});
|
||||
});
|
||||
|
||||
$grade->students->each(function ($student) use ($grade, $scores) {
|
||||
$grade->lessons->each(function ($lesson) use ($student, $scores) {
|
||||
$student->lessons()
|
||||
->syncWithoutDetaching([
|
||||
$lesson->id => ['score' => $scores[array_rand($scores)]]
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
92
lang/en.json
Normal file
92
lang/en.json
Normal file
@ -0,0 +1,92 @@
|
||||
{
|
||||
"(and :count more error)": "(and :count more error)",
|
||||
"(and :count more errors)": "(and :count more error)|(and :count more errors)|(and :count more errors)",
|
||||
"A fresh verification link has been sent to your email address.": "A fresh verification link has been sent to your email address.",
|
||||
"A new verification link has been sent to the email address you provided during registration.": "A new verification link has been sent to the email address you provided during registration.",
|
||||
"A new verification link has been sent to your email address.": "A new verification link has been sent to your email address.",
|
||||
"All rights reserved.": "All rights reserved.",
|
||||
"Already registered?": "Already registered?",
|
||||
"Are you sure you want to delete your account?": "Are you sure you want to delete your account?",
|
||||
"Before proceeding, please check your email for a verification link.": "Before proceeding, please check your email for a verification link.",
|
||||
"Cancel": "Cancel",
|
||||
"Click here to re-send the verification email.": "Click here to re-send the verification email.",
|
||||
"click here to request another": "click here to request another",
|
||||
"Confirm": "Confirm",
|
||||
"Confirm Password": "Confirm Password",
|
||||
"Current Password": "Current Password",
|
||||
"Dashboard": "Dashboard",
|
||||
"Delete Account": "Delete Account",
|
||||
"Email": "Email",
|
||||
"email": "The :attribute must be a valid email address.",
|
||||
"Email Address": "Email Address",
|
||||
"Email Password Reset Link": "Email Password Reset Link",
|
||||
"Ensure your account is using a long, random password to stay secure.": "Ensure your account is using a long, random password to stay secure.",
|
||||
"errors": "errors",
|
||||
"Forbidden": "Forbidden",
|
||||
"Forgot Your Password?": "Forgot Your Password?",
|
||||
"Forgot your password?": "Forgot your password?",
|
||||
"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.": "Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.",
|
||||
"Go to page :page": "Go to page :page",
|
||||
"Hello!": "Hello!",
|
||||
"If you did not create an account, no further action is required.": "If you did not create an account, no further action is required.",
|
||||
"If you did not receive the email": "If you did not receive the email",
|
||||
"If you did not request a password reset, no further action is required.": "If you did not request a password reset, no further action is required.",
|
||||
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:",
|
||||
"Invalid JSON was returned from the route.": "Invalid JSON was returned from the route.",
|
||||
"length": "length",
|
||||
"Location": "Location",
|
||||
"Log in": "Log in",
|
||||
"Log Out": "Log Out",
|
||||
"Login": "Login",
|
||||
"Logout": "Logout",
|
||||
"Name": "Name",
|
||||
"name": "name",
|
||||
"New Password": "New Password",
|
||||
"Not Found": "Not Found",
|
||||
"of": "of",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.",
|
||||
"Page Expired": "Page Expired",
|
||||
"Pagination Navigation": "Pagination Navigation",
|
||||
"Password": "Password",
|
||||
"password": "The password is incorrect.",
|
||||
"Payment Required": "Payment Required",
|
||||
"Please click the button below to verify your email address.": "Please click the button below to verify your email address.",
|
||||
"Please confirm your password before continuing.": "Please confirm your password before continuing.",
|
||||
"Profile": "Profile",
|
||||
"Profile Information": "Profile Information",
|
||||
"Regards": "Regards",
|
||||
"Register": "Register",
|
||||
"Remember Me": "Remember Me",
|
||||
"Remember me": "Remember me",
|
||||
"Resend Verification Email": "Resend Verification Email",
|
||||
"Reset Password": "Reset Password",
|
||||
"Reset Password Notification": "Reset Password Notification",
|
||||
"results": "results",
|
||||
"Save": "Save",
|
||||
"Saved.": "Saved.",
|
||||
"Send Password Reset Link": "Send Password Reset Link",
|
||||
"Server Error": "Server Error",
|
||||
"Service Unavailable": "Service Unavailable",
|
||||
"Showing": "Showing",
|
||||
"Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.",
|
||||
"The given data was invalid.": "The given data was invalid.",
|
||||
"The response is not a streamed response.": "The response is not a streamed response.",
|
||||
"The response is not a view.": "The response is not a view.",
|
||||
"This action is unauthorized.": "This action is unauthorized.",
|
||||
"This is a secure area of the application. Please confirm your password before continuing.": "This is a secure area of the application. Please confirm your password before continuing.",
|
||||
"This password reset link will expire in :count minutes.": "This password reset link will expire in :count minutes.",
|
||||
"to": "to",
|
||||
"Toggle navigation": "Toggle navigation",
|
||||
"Too Many Requests": "Too Many Requests",
|
||||
"Unauthorized": "Unauthorized",
|
||||
"Update Password": "Update Password",
|
||||
"Update your account's profile information and email address.": "Update your account's profile information and email address.",
|
||||
"Verify Email Address": "Verify Email Address",
|
||||
"Verify Your Email Address": "Verify Your Email Address",
|
||||
"Whoops!": "Whoops!",
|
||||
"You are logged in!": "You are logged in!",
|
||||
"You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account.",
|
||||
"You're logged in!": "You're logged in!",
|
||||
"Your email address is unverified.": "Your email address is unverified."
|
||||
}
|
9
lang/en/auth.php
Normal file
9
lang/en/auth.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'failed' => 'These credentials do not match our records.',
|
||||
'password' => 'The password is incorrect.',
|
||||
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
|
||||
];
|
8
lang/en/pagination.php
Normal file
8
lang/en/pagination.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'next' => 'Next »',
|
||||
'previous' => '« Previous',
|
||||
];
|
11
lang/en/passwords.php
Normal file
11
lang/en/passwords.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'reset' => 'Your password has been reset.',
|
||||
'sent' => 'We have emailed your password reset link.',
|
||||
'throttled' => 'Please wait before retrying.',
|
||||
'token' => 'This password reset token is invalid.',
|
||||
'user' => 'We can\'t find a user with that email address.',
|
||||
];
|
153
lang/en/validation.php
Normal file
153
lang/en/validation.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'accepted' => 'The :attribute must be accepted.',
|
||||
'accepted_if' => 'The :attribute must be accepted when :other is :value.',
|
||||
'active_url' => 'The :attribute is not a valid URL.',
|
||||
'after' => 'The :attribute must be a date after :date.',
|
||||
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
|
||||
'alpha' => 'The :attribute must only contain letters.',
|
||||
'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
|
||||
'alpha_num' => 'The :attribute must only contain letters and numbers.',
|
||||
'array' => 'The :attribute must be an array.',
|
||||
'ascii' => 'The :attribute field must only contain single-byte alphanumeric characters and symbols.',
|
||||
'before' => 'The :attribute must be a date before :date.',
|
||||
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
|
||||
'between' => [
|
||||
'array' => 'The :attribute must have between :min and :max items.',
|
||||
'file' => 'The :attribute must be between :min and :max kilobytes.',
|
||||
'numeric' => 'The :attribute must be between :min and :max.',
|
||||
'string' => 'The :attribute must be between :min and :max characters.',
|
||||
],
|
||||
'boolean' => 'The :attribute field must be true or false.',
|
||||
'can' => 'The :attribute field contains an unauthorized value.',
|
||||
'confirmed' => 'The :attribute confirmation does not match.',
|
||||
'contains' => 'The :attribute field is missing a required value.',
|
||||
'current_password' => 'The password is incorrect.',
|
||||
'date' => 'The :attribute is not a valid date.',
|
||||
'date_equals' => 'The :attribute must be a date equal to :date.',
|
||||
'date_format' => 'The :attribute does not match the format :format.',
|
||||
'decimal' => 'The :attribute field must have :decimal decimal places.',
|
||||
'declined' => 'The :attribute must be declined.',
|
||||
'declined_if' => 'The :attribute must be declined when :other is :value.',
|
||||
'different' => 'The :attribute and :other must be different.',
|
||||
'digits' => 'The :attribute must be :digits digits.',
|
||||
'digits_between' => 'The :attribute must be between :min and :max digits.',
|
||||
'dimensions' => 'The :attribute has invalid image dimensions.',
|
||||
'distinct' => 'The :attribute field has a duplicate value.',
|
||||
'doesnt_end_with' => 'The :attribute field must not end with one of the following: :values.',
|
||||
'doesnt_start_with' => 'The :attribute field must not start with one of the following: :values.',
|
||||
'email' => 'The :attribute must be a valid email address.',
|
||||
'ends_with' => 'The :attribute must end with one of the following: :values.',
|
||||
'enum' => 'The :attribute field value is not in the list of allowed values.',
|
||||
'exists' => 'The :attribute field value does not exist.',
|
||||
'extensions' => 'The :attribute field must have one of the following extensions: :values.',
|
||||
'file' => 'The :attribute must be a file.',
|
||||
'filled' => 'The :attribute field must have a value.',
|
||||
'gt' => [
|
||||
'array' => 'The :attribute must have more than :value items.',
|
||||
'file' => 'The :attribute must be greater than :value kilobytes.',
|
||||
'numeric' => 'The :attribute must be greater than :value.',
|
||||
'string' => 'The :attribute must be greater than :value characters.',
|
||||
],
|
||||
'gte' => [
|
||||
'array' => 'The :attribute must have :value items or more.',
|
||||
'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
|
||||
'numeric' => 'The :attribute must be greater than or equal to :value.',
|
||||
'string' => 'The :attribute must be greater than or equal to :value characters.',
|
||||
],
|
||||
'hex_color' => 'The :attribute field must be a valid hexadecimal color.',
|
||||
'image' => 'The :attribute must be an image.',
|
||||
'in' => 'The :attribute field value is not in the list of allowed values.',
|
||||
'in_array' => 'The :attribute field does not exist in :other.',
|
||||
'integer' => 'The :attribute must be an integer.',
|
||||
'ip' => 'The :attribute must be a valid IP address.',
|
||||
'ipv4' => 'The :attribute must be a valid IPv4 address.',
|
||||
'ipv6' => 'The :attribute must be a valid IPv6 address.',
|
||||
'json' => 'The :attribute must be a valid JSON string.',
|
||||
'list' => 'The :attribute field must be a list.',
|
||||
'lowercase' => 'The :attribute field must be lowercase.',
|
||||
'lt' => [
|
||||
'array' => 'The :attribute must have less than :value items.',
|
||||
'file' => 'The :attribute must be less than :value kilobytes.',
|
||||
'numeric' => 'The :attribute must be less than :value.',
|
||||
'string' => 'The :attribute must be less than :value characters.',
|
||||
],
|
||||
'lte' => [
|
||||
'array' => 'The :attribute must not have more than :value items.',
|
||||
'file' => 'The :attribute must be less than or equal to :value kilobytes.',
|
||||
'numeric' => 'The :attribute must be less than or equal to :value.',
|
||||
'string' => 'The :attribute must be less than or equal to :value characters.',
|
||||
],
|
||||
'mac_address' => 'The :attribute must be a valid MAC address.',
|
||||
'max' => [
|
||||
'array' => 'The :attribute must not have more than :max items.',
|
||||
'file' => 'The :attribute must not be greater than :max kilobytes.',
|
||||
'numeric' => 'The :attribute must not be greater than :max.',
|
||||
'string' => 'The :attribute must not be greater than :max characters.',
|
||||
],
|
||||
'max_digits' => 'The :attribute field must not have more than :max digits.',
|
||||
'mimes' => 'The :attribute must be a file of type: :values.',
|
||||
'mimetypes' => 'The :attribute must be a file of type: :values.',
|
||||
'min' => [
|
||||
'array' => 'The :attribute must have at least :min items.',
|
||||
'file' => 'The :attribute must be at least :min kilobytes.',
|
||||
'numeric' => 'The :attribute must be at least :min.',
|
||||
'string' => 'The :attribute must be at least :min characters.',
|
||||
],
|
||||
'min_digits' => 'The :attribute field must have at least :min digits.',
|
||||
'missing' => 'The :attribute field must be missing.',
|
||||
'missing_if' => 'The :attribute field must be missing when :other is :value.',
|
||||
'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
|
||||
'missing_with' => 'The :attribute field must be missing when :values is present.',
|
||||
'missing_with_all' => 'The :attribute field must be missing when :values are present.',
|
||||
'multiple_of' => 'The :attribute must be a multiple of :value.',
|
||||
'not_in' => 'The :attribute field must not be in the list.',
|
||||
'not_regex' => 'The :attribute format is invalid.',
|
||||
'numeric' => 'The :attribute must be a number.',
|
||||
'password' => [
|
||||
'letters' => 'The :attribute field must contain at least one letter.',
|
||||
'mixed' => 'The :attribute field must contain at least one uppercase and one lowercase letter.',
|
||||
'numbers' => 'The :attribute field must contain at least one number.',
|
||||
'symbols' => 'The :attribute field must contain at least one symbol.',
|
||||
'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
|
||||
],
|
||||
'present' => 'The :attribute field must be present.',
|
||||
'present_if' => 'The :attribute field must be present when :other is :value.',
|
||||
'present_unless' => 'The :attribute field must be present unless :other is :value.',
|
||||
'present_with' => 'The :attribute field must be present when :values is present.',
|
||||
'present_with_all' => 'The :attribute field must be present when :values are present.',
|
||||
'prohibited' => 'The :attribute field is prohibited.',
|
||||
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
|
||||
'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
|
||||
'prohibits' => 'The :attribute field prohibits :other from being present.',
|
||||
'regex' => 'The :attribute format is invalid.',
|
||||
'required' => 'The :attribute field is required.',
|
||||
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
|
||||
'required_if' => 'The :attribute field is required when :other is :value.',
|
||||
'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
|
||||
'required_if_declined' => 'The :attribute field is required when :other is declined.',
|
||||
'required_unless' => 'The :attribute field is required unless :other is in :values.',
|
||||
'required_with' => 'The :attribute field is required when :values is present.',
|
||||
'required_with_all' => 'The :attribute field is required when :values are present.',
|
||||
'required_without' => 'The :attribute field is required when :values is not present.',
|
||||
'required_without_all' => 'The :attribute field is required when none of :values are present.',
|
||||
'same' => 'The :attribute and :other must match.',
|
||||
'size' => [
|
||||
'array' => 'The :attribute must contain :size items.',
|
||||
'file' => 'The :attribute must be :size kilobytes.',
|
||||
'numeric' => 'The :attribute must be :size.',
|
||||
'string' => 'The :attribute must be :size characters.',
|
||||
],
|
||||
'starts_with' => 'The :attribute must start with one of the following: :values.',
|
||||
'string' => 'The :attribute must be a string.',
|
||||
'timezone' => 'The :attribute must be a valid timezone.',
|
||||
'ulid' => 'The :attribute field must be a valid ULID.',
|
||||
'unique' => 'The :attribute has already been taken.',
|
||||
'uploaded' => 'The :attribute failed to upload.',
|
||||
'uppercase' => 'The :attribute field must be uppercase.',
|
||||
'url' => 'The :attribute must be a valid URL.',
|
||||
'uuid' => 'The :attribute must be a valid UUID.',
|
||||
];
|
92
lang/ru.json
Normal file
92
lang/ru.json
Normal file
@ -0,0 +1,92 @@
|
||||
{
|
||||
"(and :count more error)": "(и ещё :count ошибка)",
|
||||
"(and :count more errors)": "(и ещё :count ошибка)|(и ещё :count ошибки)|(и ещё :count ошибок)",
|
||||
"A fresh verification link has been sent to your email address.": "Новая ссылка подтверждения отправлена на Ваш адрес электронной почты.",
|
||||
"A new verification link has been sent to the email address you provided during registration.": "Новая ссылка для подтверждения была отправлена на Ваш адрес электронной почты, указанный при регистрации.",
|
||||
"A new verification link has been sent to your email address.": "На Ваш адрес электронной почты отправлена новая ссылка для подтверждения.",
|
||||
"All rights reserved.": "Все права защищены.",
|
||||
"Already registered?": "Уже зарегистрированы?",
|
||||
"Are you sure you want to delete your account?": "Вы уверены что хотите удалить свою учётную запись?",
|
||||
"Before proceeding, please check your email for a verification link.": "Прежде чем продолжить, проверьте свою электронную почту на наличие ссылки для подтверждения.",
|
||||
"Cancel": "Отмена",
|
||||
"Click here to re-send the verification email.": "Нажмите здесь, чтобы повторно отправить электронное письмо для подтверждения.",
|
||||
"click here to request another": "нажмите здесь для запроса другой ссылки",
|
||||
"Confirm": "Подтвердить",
|
||||
"Confirm Password": "Подтвердить пароль",
|
||||
"Current Password": "Текущий пароль",
|
||||
"Dashboard": "Панель",
|
||||
"Delete Account": "Удалить аккаунт",
|
||||
"Email": "Адрес электронной почты",
|
||||
"email": "Значение поля :attribute должно быть действительным электронным адресом.",
|
||||
"Email Address": "Адрес электронной почты",
|
||||
"Email Password Reset Link": "Ссылка для сброса пароля",
|
||||
"Ensure your account is using a long, random password to stay secure.": "В целях безопасности убедитесь, что Вы используете длинный случайный пароль.",
|
||||
"errors": "ошибки",
|
||||
"Forbidden": "Запрещено",
|
||||
"Forgot Your Password?": "Забыли пароль?",
|
||||
"Forgot your password?": "Забыли пароль?",
|
||||
"Forgot your password? No problem. Just let us know your email address and we will email you a password reset link that will allow you to choose a new one.": "Забыли пароль? Нет проблем. Просто сообщите Ваш адрес электронной почты и мы пришлём Вам ссылку для сброса пароля.",
|
||||
"Go to page :page": "Перейти к :page-й странице",
|
||||
"Hello!": "Здравствуйте!",
|
||||
"If you did not create an account, no further action is required.": "Если Вы не создавали учетную запись, никаких дополнительных действий не требуется.",
|
||||
"If you did not receive the email": "Если Вы не получили письмо",
|
||||
"If you did not request a password reset, no further action is required.": "Если Вы не запрашивали восстановление пароля, никаких дополнительных действий не требуется.",
|
||||
"If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Если у Вас возникли проблемы с нажатием кнопки \":actionText\", скопируйте и вставьте приведенный ниже URL-адрес в свой браузер:",
|
||||
"Invalid JSON was returned from the route.": "Маршрут вернул некорректный JSON.",
|
||||
"length": "длина",
|
||||
"Location": "Местоположение",
|
||||
"Log in": "Войти",
|
||||
"Log Out": "Выйти",
|
||||
"Login": "Войти",
|
||||
"Logout": "Выйти",
|
||||
"Name": "Имя",
|
||||
"name": "имя",
|
||||
"New Password": "Новый пароль",
|
||||
"Not Found": "Не найдено",
|
||||
"of": "из",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.": "После удаления Вашей учётной записи все её ресурсы и данные будут удалены без возможности восстановления. Перед удалением учётной записи загрузите данные и информацию, которую хотите сохранить.",
|
||||
"Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.": "После удаления Вашей учётной записи все её ресурсы и данные будут удалены без возможности восстановления. Пожалуйста, введите свой пароль для подтверждения удаления учётной записи.",
|
||||
"Page Expired": "Страница устарела",
|
||||
"Pagination Navigation": "Навигация",
|
||||
"Password": "Пароль",
|
||||
"password": "Некорректный пароль.",
|
||||
"Payment Required": "Требуется оплата",
|
||||
"Please click the button below to verify your email address.": "Пожалуйста, нажмите кнопку ниже, чтобы подтвердить свой адрес электронной почты.",
|
||||
"Please confirm your password before continuing.": "Пожалуйста, подтвердите свой пароль, прежде чем продолжить.",
|
||||
"Profile": "Профиль",
|
||||
"Profile Information": "Информация профиля",
|
||||
"Regards": "С уважением",
|
||||
"Register": "Регистрация",
|
||||
"Remember Me": "Запомнить меня",
|
||||
"Remember me": "Запомнить меня",
|
||||
"Resend Verification Email": "Выслать повторно письмо для подтверждения",
|
||||
"Reset Password": "Сбросить пароль",
|
||||
"Reset Password Notification": "Оповещение о сбросе пароля",
|
||||
"results": "результатов",
|
||||
"Save": "Сохранить",
|
||||
"Saved.": "Сохранено.",
|
||||
"Send Password Reset Link": "Отправить ссылку сброса пароля",
|
||||
"Server Error": "Ошибка сервера",
|
||||
"Service Unavailable": "Сервис недоступен",
|
||||
"Showing": "Показано с",
|
||||
"Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Спасибо за регистрацию! Прежде чем начать, не могли бы Вы подтвердить адрес своей электронной почты перейдя по ссылке, которую мы Вам отправили? Если Вы не получили письмо, мы с радостью отправим новое.",
|
||||
"The given data was invalid.": "Указанные данные недействительны.",
|
||||
"The response is not a streamed response.": "Ответ не является потоковым.",
|
||||
"The response is not a view.": "Ответ не является представлением.",
|
||||
"This action is unauthorized.": "Действие не авторизовано.",
|
||||
"This is a secure area of the application. Please confirm your password before continuing.": "Это защищённая область приложения. Пожалуйста, подтвердите Ваш пароль, прежде чем продолжить.",
|
||||
"This password reset link will expire in :count minutes.": "Срок действия ссылки для сброса пароля истекает через :count минут.",
|
||||
"to": "по",
|
||||
"Toggle navigation": "Переключить навигацию",
|
||||
"Too Many Requests": "Слишком много запросов",
|
||||
"Unauthorized": "Не авторизован",
|
||||
"Update Password": "Обновить пароль",
|
||||
"Update your account's profile information and email address.": "Обновите информацию и адрес электронной почты в профиле учётной записи.",
|
||||
"Verify Email Address": "Подтвердить адрес электронной почты",
|
||||
"Verify Your Email Address": "Подтвердите Ваш адрес электронной почты",
|
||||
"Whoops!": "Упс!",
|
||||
"You are logged in!": "Вы вошли в систему.",
|
||||
"You are receiving this email because we received a password reset request for your account.": "Вы получили это письмо, потому что мы получили запрос на сброс пароля для Вашей учётной записи.",
|
||||
"You're logged in!": "Вы уже вошли.",
|
||||
"Your email address is unverified.": "Ваш адрес электронной почты не подтверждён."
|
||||
}
|
9
lang/ru/auth.php
Normal file
9
lang/ru/auth.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'failed' => 'Неверное имя пользователя или пароль.',
|
||||
'password' => 'Некорректный пароль.',
|
||||
'throttle' => 'Слишком много попыток входа. Пожалуйста, попробуйте ещё раз через :seconds секунд.',
|
||||
];
|
8
lang/ru/pagination.php
Normal file
8
lang/ru/pagination.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'next' => 'Вперёд »',
|
||||
'previous' => '« Назад',
|
||||
];
|
11
lang/ru/passwords.php
Normal file
11
lang/ru/passwords.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'reset' => 'Ваш пароль был сброшен.',
|
||||
'sent' => 'Ссылка на сброс пароля была отправлена.',
|
||||
'throttled' => 'Пожалуйста, подождите перед повторной попыткой.',
|
||||
'token' => 'Ошибочный код сброса пароля.',
|
||||
'user' => 'Не удалось найти пользователя с указанным электронным адресом.',
|
||||
];
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user