Compare commits
No commits in common. "master" and "feature/task-11" have entirely different histories.
master
...
feature/ta
@ -1,43 +0,0 @@
|
|||||||
<?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]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,16 +8,4 @@ enum TypeLesson: string
|
|||||||
case Classwork = "Работа в классе";
|
case Classwork = "Работа в классе";
|
||||||
case TestClass = "Самостоятельная работа";
|
case TestClass = "Самостоятельная работа";
|
||||||
case ExamClass = "Контрольная работа";
|
case ExamClass = "Контрольная работа";
|
||||||
|
|
||||||
public static function getShortType($type)
|
|
||||||
{
|
|
||||||
|
|
||||||
return match ($type) {
|
|
||||||
self::Homework->value => "д/р",
|
|
||||||
self::Classwork->value => "кл/р",
|
|
||||||
self::TestClass->value => "с/р",
|
|
||||||
self::ExamClass->value => "к/р",
|
|
||||||
default => "-",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
<?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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -69,7 +69,7 @@ class GradeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit(Grade $grade): View
|
public function edit(Grade $grade): View
|
||||||
{
|
{
|
||||||
if(request()->user()->cannot('update', $grade)) {
|
if(request()->user()->cannot('update', Grade::class)) {
|
||||||
abort(403);
|
abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,13 +83,11 @@ class GradeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function update(GradePostRequest $request, Grade $grade): RedirectResponse
|
public function update(GradePostRequest $request, Grade $grade): RedirectResponse
|
||||||
{
|
{
|
||||||
if(request()->user()->cannot('update', $grade)) {
|
if(request()->user()->cannot('update', Grade::class)) {
|
||||||
abort(403);
|
abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$grade->update($request->validated());
|
return redirect()->route('grades.show', $grade->update($request->validated()));
|
||||||
|
|
||||||
return redirect()->route('grades.show', $grade);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,10 +95,9 @@ class GradeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy(Grade $grade): RedirectResponse
|
public function destroy(Grade $grade): RedirectResponse
|
||||||
{
|
{
|
||||||
if(request()->user()->cannot('delete', $grade)) {
|
if(request()->user()->cannot('delete', Grade::class)) {
|
||||||
abort(403);
|
abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$grade->delete();
|
$grade->delete();
|
||||||
|
|
||||||
return redirect()->route('grades.index');
|
return redirect()->route('grades.index');
|
||||||
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|||||||
use App\Http\Requests\GradeSubjectPostRequest;
|
use App\Http\Requests\GradeSubjectPostRequest;
|
||||||
use App\Models\Grade;
|
use App\Models\Grade;
|
||||||
use App\Models\Subject;
|
use App\Models\Subject;
|
||||||
use App\Services\FileService;
|
|
||||||
use App\Services\JournalService;
|
use App\Services\JournalService;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
@ -39,13 +38,6 @@ class GradeSubjectController extends Controller
|
|||||||
return view('grade-subject.journal', [
|
return view('grade-subject.journal', [
|
||||||
'lessons' => $grade->lessons()->where('subject_id', $subject->id)->with('students')->get(),
|
'lessons' => $grade->lessons()->where('subject_id', $subject->id)->with('students')->get(),
|
||||||
'students' => $grade->students()->orderBy('last_name')->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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -113,9 +113,12 @@ class LessonController extends Controller
|
|||||||
abort(403);
|
abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$lesson->update($request->validated());
|
return redirect()->route(
|
||||||
|
'grades.lessons.show',[
|
||||||
return redirect()->route('grades.lessons.show',[$grade, $lesson,]);
|
$grade,
|
||||||
|
$lesson->update($request->validated()),
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,7 @@ class ScoreController extends Controller
|
|||||||
public function show(Lesson $lesson)
|
public function show(Lesson $lesson)
|
||||||
{
|
{
|
||||||
return view('scores.show', [
|
return view('scores.show', [
|
||||||
'students' => $lesson->students()->orderBy('last_name')->get(),
|
'students' => $lesson->students,
|
||||||
'lesson' => $lesson,
|
'lesson' => $lesson,
|
||||||
'scores' => ScoreEnum::cases(),
|
'scores' => ScoreEnum::cases(),
|
||||||
]);
|
]);
|
||||||
|
@ -6,7 +6,6 @@ use App\Http\Requests\StudentPostRequest;
|
|||||||
use App\Models\Grade;
|
use App\Models\Grade;
|
||||||
use App\Models\Student;
|
use App\Models\Student;
|
||||||
use App\Models\Subject;
|
use App\Models\Subject;
|
||||||
use App\Services\FileService;
|
|
||||||
use App\Services\StudentService;
|
use App\Services\StudentService;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
@ -135,9 +134,4 @@ class StudentController extends Controller
|
|||||||
'lessons' => $service->getDebts(),
|
'lessons' => $service->getDebts(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exportAvgScores(StudentService $service)
|
|
||||||
{
|
|
||||||
return $service->exportAvgScores();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -82,9 +82,10 @@ class SubjectController extends Controller
|
|||||||
abort(403);
|
abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject->update($request->validated());
|
return redirect()->route(
|
||||||
|
'subjects.show',
|
||||||
return redirect()->route('subjects.show', $subject);
|
$subject->update($request->validated())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ class StudentPostRequest extends FormRequest
|
|||||||
'middle_name' => 'required|max:255',
|
'middle_name' => 'required|max:255',
|
||||||
'birthday' => 'required|date',
|
'birthday' => 'required|date',
|
||||||
'grade_id' => 'required|exists:grades,id',
|
'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,}))$/'],
|
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->route('student')?->user->id)],
|
||||||
'password' => 'required|max:255',
|
'password' => 'required|max:255',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class TeacherPostRequest extends FormRequest
|
|||||||
'last_name' => 'required|max:255',
|
'last_name' => 'required|max:255',
|
||||||
'middle_name' => 'required|max:255',
|
'middle_name' => 'required|max:255',
|
||||||
'birthday' => 'required|date',
|
'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,}))$/'],
|
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->route('teacher')?->user->id)],
|
||||||
'password' => 'required|max:255',
|
'password' => 'required|max:255',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
<?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 [];
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,14 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Enums\TypeLesson;
|
|
||||||
use Illuminate\Contracts\Database\Eloquent\Builder;
|
use Illuminate\Contracts\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class Lesson extends Model
|
class Lesson extends Model
|
||||||
{
|
{
|
||||||
@ -53,18 +51,4 @@ class Lesson extends Model
|
|||||||
$query->where('subject_id', $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')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -3,15 +3,11 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
// 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\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
|
||||||
#[ObservedBy(UserObserver::class)]
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasFactory, Notifiable;
|
use HasFactory, Notifiable;
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
<?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']));
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,7 +6,6 @@ use App\Models\Admin;
|
|||||||
use App\Models\Grade;
|
use App\Models\Grade;
|
||||||
use App\Models\Lesson;
|
use App\Models\Lesson;
|
||||||
use App\Models\Student;
|
use App\Models\Student;
|
||||||
use App\Models\Teacher;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|
||||||
class LessonPolicy
|
class LessonPolicy
|
||||||
@ -14,9 +13,9 @@ class LessonPolicy
|
|||||||
/**
|
/**
|
||||||
* Determine whether the user can view any models.
|
* Determine whether the user can view any models.
|
||||||
*/
|
*/
|
||||||
public function viewAny(User $user): bool
|
public function viewAny(User $user, Grade $grade): bool
|
||||||
{
|
{
|
||||||
return $user->userable_type == Teacher::class;
|
return $user->userable_type != Student::class || $user->userable->grade_id == $grade->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +23,7 @@ class LessonPolicy
|
|||||||
*/
|
*/
|
||||||
public function view(User $user, Lesson $lesson): bool
|
public function view(User $user, Lesson $lesson): bool
|
||||||
{
|
{
|
||||||
return $user->userable_type == Teacher::class;
|
return $user->userable_type != Student::class || $user->userable->grade_id == $lesson->grade_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,7 +31,7 @@ class LessonPolicy
|
|||||||
*/
|
*/
|
||||||
public function create(User $user): bool
|
public function create(User $user): bool
|
||||||
{
|
{
|
||||||
return $user->userable_type == Teacher::class;
|
return $user->userable_type != Student::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +39,7 @@ class LessonPolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Lesson $lesson): bool
|
public function update(User $user, Lesson $lesson): bool
|
||||||
{
|
{
|
||||||
return $user->userable_type == Teacher::class;
|
return $user->userable_type != Student::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,6 +47,6 @@ class LessonPolicy
|
|||||||
*/
|
*/
|
||||||
public function delete(User $user, Lesson $lesson): bool
|
public function delete(User $user, Lesson $lesson): bool
|
||||||
{
|
{
|
||||||
return $user->userable_type == Teacher::class;
|
return $user->userable_type != Student::class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,4 @@ class StudentPolicy
|
|||||||
{
|
{
|
||||||
return $user->userable_type == Student::class;
|
return $user->userable_type == Student::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function avgScores(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->userable_type == Student::class;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,4 @@ class SubjectPolicy
|
|||||||
{
|
{
|
||||||
return $user->userable_type == Student::class;
|
return $user->userable_type == Student::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pdf(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->userable_type == Student::class;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Export\JournalExport;
|
|
||||||
use App\Models\Grade;
|
use App\Models\Grade;
|
||||||
use App\Models\Subject;
|
|
||||||
use Barryvdh\DomPDF\Facade\Pdf;
|
use Barryvdh\DomPDF\Facade\Pdf;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
|
||||||
|
|
||||||
class FileService
|
class FileService
|
||||||
{
|
{
|
||||||
@ -47,12 +44,4 @@ class FileService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ use App\Enums\ScoreEnum;
|
|||||||
use App\Models\Student;
|
use App\Models\Student;
|
||||||
use App\Models\Subject;
|
use App\Models\Subject;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Barryvdh\DomPDF\Facade\Pdf;
|
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
@ -83,18 +82,4 @@ class StudentService
|
|||||||
|
|
||||||
return $student->lessons()->whereIn('score', ScoreEnum::getDebtScores())->get();
|
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');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
"laravel/framework": "^11.0",
|
"laravel/framework": "^11.0",
|
||||||
"laravel/telescope": "^5.0",
|
"laravel/telescope": "^5.0",
|
||||||
"laravel/tinker": "^2.9",
|
"laravel/tinker": "^2.9",
|
||||||
"laravel/ui": "^4.5",
|
"laravel/ui": "^4.5"
|
||||||
"maatwebsite/excel": "^3.1"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.23",
|
"fakerphp/faker": "^1.23",
|
||||||
|
601
composer.lock
generated
601
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "04b6d198f726939fe72146f62909bd81",
|
"content-hash": "dbd9db2b0c45633cee162e5a5eb75a92",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "barryvdh/laravel-dompdf",
|
"name": "barryvdh/laravel-dompdf",
|
||||||
@ -207,87 +207,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2024-02-09T16:56:22+00:00"
|
"time": "2024-02-09T16:56:22+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "composer/semver",
|
|
||||||
"version": "3.4.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/composer/semver.git",
|
|
||||||
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
|
|
||||||
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^5.3.2 || ^7.0 || ^8.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpstan/phpstan": "^1.4",
|
|
||||||
"symfony/phpunit-bridge": "^4.2 || ^5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-main": "3.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Composer\\Semver\\": "src"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Nils Adermann",
|
|
||||||
"email": "naderman@naderman.de",
|
|
||||||
"homepage": "http://www.naderman.de"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jordi Boggiano",
|
|
||||||
"email": "j.boggiano@seld.be",
|
|
||||||
"homepage": "http://seld.be"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Rob Bast",
|
|
||||||
"email": "rob.bast@gmail.com",
|
|
||||||
"homepage": "http://robbast.nl"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Semver library that offers utilities, version constraint parsing and validation.",
|
|
||||||
"keywords": [
|
|
||||||
"semantic",
|
|
||||||
"semver",
|
|
||||||
"validation",
|
|
||||||
"versioning"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"irc": "ircs://irc.libera.chat:6697/composer",
|
|
||||||
"issues": "https://github.com/composer/semver/issues",
|
|
||||||
"source": "https://github.com/composer/semver/tree/3.4.0"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://packagist.com",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/composer",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2023-08-31T09:50:34+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "dflydev/dot-access-data",
|
"name": "dflydev/dot-access-data",
|
||||||
"version": "v3.0.2",
|
"version": "v3.0.2",
|
||||||
@ -721,67 +640,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2023-10-06T06:47:41+00:00"
|
"time": "2023-10-06T06:47:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "ezyang/htmlpurifier",
|
|
||||||
"version": "v4.17.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/ezyang/htmlpurifier.git",
|
|
||||||
"reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c",
|
|
||||||
"reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"cerdic/css-tidy": "^1.7 || ^2.0",
|
|
||||||
"simpletest/simpletest": "dev-master"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
|
|
||||||
"ext-bcmath": "Used for unit conversion and imagecrash protection",
|
|
||||||
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
|
|
||||||
"ext-tidy": "Used for pretty-printing HTML"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"library/HTMLPurifier.composer.php"
|
|
||||||
],
|
|
||||||
"psr-0": {
|
|
||||||
"HTMLPurifier": "library/"
|
|
||||||
},
|
|
||||||
"exclude-from-classmap": [
|
|
||||||
"/library/HTMLPurifier/Language/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"LGPL-2.1-or-later"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Edward Z. Yang",
|
|
||||||
"email": "admin@htmlpurifier.org",
|
|
||||||
"homepage": "http://ezyang.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Standards compliant HTML filter written in PHP",
|
|
||||||
"homepage": "http://htmlpurifier.org/",
|
|
||||||
"keywords": [
|
|
||||||
"html"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/ezyang/htmlpurifier/issues",
|
|
||||||
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0"
|
|
||||||
},
|
|
||||||
"time": "2023-11-17T15:01:25+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "fruitcake/php-cors",
|
"name": "fruitcake/php-cors",
|
||||||
"version": "v1.3.0",
|
"version": "v1.3.0",
|
||||||
@ -2239,275 +2097,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2024-01-28T23:22:08+00:00"
|
"time": "2024-01-28T23:22:08+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "maatwebsite/excel",
|
|
||||||
"version": "3.1.55",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
|
|
||||||
"reference": "6d9d791dcdb01a9b6fd6f48d46f0d5fff86e6260"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/6d9d791dcdb01a9b6fd6f48d46f0d5fff86e6260",
|
|
||||||
"reference": "6d9d791dcdb01a9b6fd6f48d46f0d5fff86e6260",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"composer/semver": "^3.3",
|
|
||||||
"ext-json": "*",
|
|
||||||
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0",
|
|
||||||
"php": "^7.0||^8.0",
|
|
||||||
"phpoffice/phpspreadsheet": "^1.18",
|
|
||||||
"psr/simple-cache": "^1.0||^2.0||^3.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"laravel/scout": "^7.0||^8.0||^9.0||^10.0",
|
|
||||||
"orchestra/testbench": "^6.0||^7.0||^8.0||^9.0",
|
|
||||||
"predis/predis": "^1.1"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"laravel": {
|
|
||||||
"providers": [
|
|
||||||
"Maatwebsite\\Excel\\ExcelServiceProvider"
|
|
||||||
],
|
|
||||||
"aliases": {
|
|
||||||
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Maatwebsite\\Excel\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Patrick Brouwers",
|
|
||||||
"email": "patrick@spartner.nl"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Supercharged Excel exports and imports in Laravel",
|
|
||||||
"keywords": [
|
|
||||||
"PHPExcel",
|
|
||||||
"batch",
|
|
||||||
"csv",
|
|
||||||
"excel",
|
|
||||||
"export",
|
|
||||||
"import",
|
|
||||||
"laravel",
|
|
||||||
"php",
|
|
||||||
"phpspreadsheet"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
|
|
||||||
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.55"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://laravel-excel.com/commercial-support",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/patrickbrouwers",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2024-02-20T08:27:10+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "maennchen/zipstream-php",
|
|
||||||
"version": "3.1.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/maennchen/ZipStream-PHP.git",
|
|
||||||
"reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
|
|
||||||
"reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-mbstring": "*",
|
|
||||||
"ext-zlib": "*",
|
|
||||||
"php-64bit": "^8.1"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"ext-zip": "*",
|
|
||||||
"friendsofphp/php-cs-fixer": "^3.16",
|
|
||||||
"guzzlehttp/guzzle": "^7.5",
|
|
||||||
"mikey179/vfsstream": "^1.6",
|
|
||||||
"php-coveralls/php-coveralls": "^2.5",
|
|
||||||
"phpunit/phpunit": "^10.0",
|
|
||||||
"vimeo/psalm": "^5.0"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"guzzlehttp/psr7": "^2.4",
|
|
||||||
"psr/http-message": "^2.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"ZipStream\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Paul Duncan",
|
|
||||||
"email": "pabs@pablotron.org"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jonatan Männchen",
|
|
||||||
"email": "jonatan@maennchen.ch"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jesse Donat",
|
|
||||||
"email": "donatj@gmail.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "András Kolesár",
|
|
||||||
"email": "kolesar@kolesar.hu"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
|
|
||||||
"keywords": [
|
|
||||||
"stream",
|
|
||||||
"zip"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
|
|
||||||
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/maennchen",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://opencollective.com/zipstream",
|
|
||||||
"type": "open_collective"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2023-06-21T14:59:35+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "markbaker/complex",
|
|
||||||
"version": "3.0.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/MarkBaker/PHPComplex.git",
|
|
||||||
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
|
|
||||||
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^7.2 || ^8.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
|
|
||||||
"phpcompatibility/php-compatibility": "^9.3",
|
|
||||||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
|
|
||||||
"squizlabs/php_codesniffer": "^3.7"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Complex\\": "classes/src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Mark Baker",
|
|
||||||
"email": "mark@lange.demon.co.uk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHP Class for working with complex numbers",
|
|
||||||
"homepage": "https://github.com/MarkBaker/PHPComplex",
|
|
||||||
"keywords": [
|
|
||||||
"complex",
|
|
||||||
"mathematics"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
|
|
||||||
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
|
|
||||||
},
|
|
||||||
"time": "2022-12-06T16:21:08+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "markbaker/matrix",
|
|
||||||
"version": "3.0.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/MarkBaker/PHPMatrix.git",
|
|
||||||
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
|
|
||||||
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^7.1 || ^8.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
|
|
||||||
"phpcompatibility/php-compatibility": "^9.3",
|
|
||||||
"phpdocumentor/phpdocumentor": "2.*",
|
|
||||||
"phploc/phploc": "^4.0",
|
|
||||||
"phpmd/phpmd": "2.*",
|
|
||||||
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
|
|
||||||
"sebastian/phpcpd": "^4.0",
|
|
||||||
"squizlabs/php_codesniffer": "^3.7"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Matrix\\": "classes/src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Mark Baker",
|
|
||||||
"email": "mark@demon-angel.eu"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHP Class for working with matrices",
|
|
||||||
"homepage": "https://github.com/MarkBaker/PHPMatrix",
|
|
||||||
"keywords": [
|
|
||||||
"mathematics",
|
|
||||||
"matrix",
|
|
||||||
"vector"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
|
|
||||||
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
|
|
||||||
},
|
|
||||||
"time": "2022-12-02T22:17:43+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "masterminds/html5",
|
"name": "masterminds/html5",
|
||||||
"version": "2.9.0",
|
"version": "2.9.0",
|
||||||
@ -3166,111 +2755,6 @@
|
|||||||
},
|
},
|
||||||
"time": "2024-04-08T12:52:34+00:00"
|
"time": "2024-04-08T12:52:34+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "phpoffice/phpspreadsheet",
|
|
||||||
"version": "1.29.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
|
|
||||||
"reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fde2ccf55eaef7e86021ff1acce26479160a0fa0",
|
|
||||||
"reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-ctype": "*",
|
|
||||||
"ext-dom": "*",
|
|
||||||
"ext-fileinfo": "*",
|
|
||||||
"ext-gd": "*",
|
|
||||||
"ext-iconv": "*",
|
|
||||||
"ext-libxml": "*",
|
|
||||||
"ext-mbstring": "*",
|
|
||||||
"ext-simplexml": "*",
|
|
||||||
"ext-xml": "*",
|
|
||||||
"ext-xmlreader": "*",
|
|
||||||
"ext-xmlwriter": "*",
|
|
||||||
"ext-zip": "*",
|
|
||||||
"ext-zlib": "*",
|
|
||||||
"ezyang/htmlpurifier": "^4.15",
|
|
||||||
"maennchen/zipstream-php": "^2.1 || ^3.0",
|
|
||||||
"markbaker/complex": "^3.0",
|
|
||||||
"markbaker/matrix": "^3.0",
|
|
||||||
"php": "^7.4 || ^8.0",
|
|
||||||
"psr/http-client": "^1.0",
|
|
||||||
"psr/http-factory": "^1.0",
|
|
||||||
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
|
|
||||||
"dompdf/dompdf": "^1.0 || ^2.0",
|
|
||||||
"friendsofphp/php-cs-fixer": "^3.2",
|
|
||||||
"mitoteam/jpgraph": "^10.3",
|
|
||||||
"mpdf/mpdf": "^8.1.1",
|
|
||||||
"phpcompatibility/php-compatibility": "^9.3",
|
|
||||||
"phpstan/phpstan": "^1.1",
|
|
||||||
"phpstan/phpstan-phpunit": "^1.0",
|
|
||||||
"phpunit/phpunit": "^8.5 || ^9.0 || ^10.0",
|
|
||||||
"squizlabs/php_codesniffer": "^3.7",
|
|
||||||
"tecnickcom/tcpdf": "^6.5"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
|
|
||||||
"ext-intl": "PHP Internationalization Functions",
|
|
||||||
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
|
|
||||||
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
|
|
||||||
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Maarten Balliauw",
|
|
||||||
"homepage": "https://blog.maartenballiauw.be"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Mark Baker",
|
|
||||||
"homepage": "https://markbakeruk.net"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Franck Lefevre",
|
|
||||||
"homepage": "https://rootslabs.net"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Erik Tilt"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Adrien Crivelli"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
|
|
||||||
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
|
|
||||||
"keywords": [
|
|
||||||
"OpenXML",
|
|
||||||
"excel",
|
|
||||||
"gnumeric",
|
|
||||||
"ods",
|
|
||||||
"php",
|
|
||||||
"spreadsheet",
|
|
||||||
"xls",
|
|
||||||
"xlsx"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
|
|
||||||
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.0"
|
|
||||||
},
|
|
||||||
"time": "2023-06-14T22:48:31+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "phpoption/phpoption",
|
"name": "phpoption/phpoption",
|
||||||
"version": "1.9.2",
|
"version": "1.9.2",
|
||||||
@ -6741,6 +6225,87 @@
|
|||||||
},
|
},
|
||||||
"time": "2024-01-28T17:52:47+00:00"
|
"time": "2024-01-28T17:52:47+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "composer/semver",
|
||||||
|
"version": "3.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/composer/semver.git",
|
||||||
|
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
|
||||||
|
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^5.3.2 || ^7.0 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpstan/phpstan": "^1.4",
|
||||||
|
"symfony/phpunit-bridge": "^4.2 || ^5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "3.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Composer\\Semver\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nils Adermann",
|
||||||
|
"email": "naderman@naderman.de",
|
||||||
|
"homepage": "http://www.naderman.de"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jordi Boggiano",
|
||||||
|
"email": "j.boggiano@seld.be",
|
||||||
|
"homepage": "http://seld.be"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rob Bast",
|
||||||
|
"email": "rob.bast@gmail.com",
|
||||||
|
"homepage": "http://robbast.nl"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Semver library that offers utilities, version constraint parsing and validation.",
|
||||||
|
"keywords": [
|
||||||
|
"semantic",
|
||||||
|
"semver",
|
||||||
|
"validation",
|
||||||
|
"versioning"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"irc": "ircs://irc.libera.chat:6697/composer",
|
||||||
|
"issues": "https://github.com/composer/semver/issues",
|
||||||
|
"source": "https://github.com/composer/semver/tree/3.4.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://packagist.com",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/composer",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-08-31T09:50:34+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "dragon-code/contracts",
|
"name": "dragon-code/contracts",
|
||||||
"version": "2.23.0",
|
"version": "2.23.0",
|
||||||
@ -10147,5 +9712,5 @@
|
|||||||
"php": "^8.2"
|
"php": "^8.2"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.2.0"
|
||||||
}
|
}
|
||||||
|
379
config/excel.php
379
config/excel.php
@ -1,379 +0,0 @@
|
|||||||
<?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,
|
|
||||||
],
|
|
||||||
];
|
|
@ -15,7 +15,6 @@ return [
|
|||||||
|
|
||||||
'commands' => [
|
'commands' => [
|
||||||
App\Console\Commands\AddAdmin::class,
|
App\Console\Commands\AddAdmin::class,
|
||||||
App\Console\Commands\AddScores::class,
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -5,31 +5,28 @@
|
|||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
@if (count($students))
|
@if (count($students))
|
||||||
<div class="card mt-4">
|
<div class="card mt-4">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
<div class="card-header">{{__('Журнал')}}</div>
|
||||||
{{__('Журнал')}}
|
|
||||||
<a href="{{ route('export-excel', [$grade, $subject]) }}" class="btn btn-info">Excel</a>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col"></th>
|
<th scope="col">ФИО</th>
|
||||||
@foreach ($lessons as $lesson)
|
@foreach ($lessons as $lesson)
|
||||||
<th style="text-align: center; vertical-align: middle;" scope="col">{{ $lesson->date }}</th>
|
<th scope="col">{{ $lesson->lesson_date }}</th>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="text-align: center; vertical-align: middle;" scope="col">ФИО</th>
|
<th scope="col"></th>
|
||||||
@foreach ($lessons as $lesson)
|
@foreach ($lessons as $lesson)
|
||||||
<th style="text-align: center; vertical-align: middle;" scope="col">{{ $lesson->shortType }}</th>
|
<th scope="col">{{ $lesson->type }}</th>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($students as $student)
|
@foreach ($students as $student)
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center; vertical-align: middle;"> {{ $student->fio }}</td>
|
<td> {{ $student->fio }}</td>
|
||||||
@foreach ($lessons as $lesson)
|
@foreach ($lessons as $lesson)
|
||||||
<td style="text-align: center; vertical-align: middle;">
|
<td style="text-align: center; vertical-align: middle;">
|
||||||
{{ $student->lessons->find($lesson->id)->pivot->score ?? "-" }}
|
{{ $student->lessons->find($lesson->id)->pivot->score ?? "-" }}
|
||||||
@ -37,11 +34,23 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
{{-- <tr>--}}
|
||||||
|
{{-- <td>Средняя оценка</td>--}}
|
||||||
|
{{-- @foreach ($avgScores as $avgScore)--}}
|
||||||
|
{{-- <td style="text-align: center; vertical-align: middle;">--}}
|
||||||
|
{{-- {{ $avgScore ? $avgScore : "" }}--}}
|
||||||
|
{{-- </td>--}}
|
||||||
|
{{-- @endforeach--}}
|
||||||
|
{{-- </tr>--}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{-- <div class="mt-4">--}}
|
||||||
|
{{-- @include('journals.list', ['users' => $goods, 'studentName' => 'хорошистов'])--}}
|
||||||
|
{{-- @include('journals.list', ['users' => $perfects, 'studentName' => 'отличников'])--}}
|
||||||
|
{{-- </div>--}}
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,13 +36,11 @@
|
|||||||
class="btn btn-block col-8">{{ $grade->name }}</a>
|
class="btn btn-block col-8">{{ $grade->name }}</a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@can('viewAny', \App\Models\Lesson::class)
|
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<div>
|
||||||
<a href="{{ route('grades.lessons.index', $grade) }}" class="btn btn-primary">Занятия</a>
|
<a href="{{ route('grades.lessons.index', $grade) }}" class="btn btn-primary">Занятия</a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@endcan
|
|
||||||
@can('list', \App\Models\Grade::class)
|
@can('list', \App\Models\Grade::class)
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
<div>
|
|
||||||
Ваш пароль для входа на {{ url('/') }}: {{ $password }}
|
|
||||||
</div>
|
|
@ -1,43 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
||||||
<style>
|
|
||||||
* { font-family: DejaVu Sans !important; }
|
|
||||||
table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
table, th, td {
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
th, td {
|
|
||||||
padding: 8px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
th {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<title>Успеваемость ученика</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Информация об успеваемости</h1>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Предмет</th>
|
|
||||||
<th>Средняя оценка</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach($avgScores as $key => $item)
|
|
||||||
<tr>
|
|
||||||
<td>{{ $key }}</td>
|
|
||||||
<td>{{ $item }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -18,12 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mt-4">
|
<div class="card mt-4">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
<div class="card-header">{{__('Предметы')}}</div>
|
||||||
{{__('Предметы')}}
|
|
||||||
@can('avgScores', \App\Models\Student::class)
|
|
||||||
<a href="{{ route('export-avg-scores') }}" class="btn btn-primary">Успеваемость</a>
|
|
||||||
@endcan
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@if (count($subjects))
|
@if (count($subjects))
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
@ -74,9 +69,7 @@
|
|||||||
@can('create', \App\Models\Subject::class)
|
@can('create', \App\Models\Subject::class)
|
||||||
<a href="{{ route('subjects.create') }}" class="btn btn-success">Добавить</a>
|
<a href="{{ route('subjects.create') }}" class="btn btn-success">Добавить</a>
|
||||||
@endcan
|
@endcan
|
||||||
@can('pdf', \App\Models\Subject::class)
|
|
||||||
<a href="{{ route('export-pdf') }}" class="btn btn-info">PDF</a>
|
<a href="{{ route('export-pdf') }}" class="btn btn-info">PDF</a>
|
||||||
@endcan
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">{{ $subjects->links() }}</div>
|
<div class="card-footer">{{ $subjects->links() }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,7 +47,6 @@ Route::middleware('auth')->group(function () {
|
|||||||
Route::put('lessons/{lesson}/scores', [ScoreController::class, 'update'])->name('lessons.scores.update');
|
Route::put('lessons/{lesson}/scores', [ScoreController::class, 'update'])->name('lessons.scores.update');
|
||||||
Route::get('grades/{grade}/subjects/{subject}/journal', [GradeSubjectController::class, 'journal'])->name('grades.subjects.journal');
|
Route::get('grades/{grade}/subjects/{subject}/journal', [GradeSubjectController::class, 'journal'])->name('grades.subjects.journal');
|
||||||
Route::get('grades/{grade}/list-students', [GradeController::class, 'listStudents'])->name('list-students');
|
Route::get('grades/{grade}/list-students', [GradeController::class, 'listStudents'])->name('list-students');
|
||||||
Route::get('grades/{grade}/subjects/{subject}/journal/export-excel', [GradeSubjectController::class, 'exportToExcel'])->name('export-excel');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::middleware([StudentAction::class])->group(function () {
|
Route::middleware([StudentAction::class])->group(function () {
|
||||||
@ -55,7 +54,6 @@ Route::middleware('auth')->group(function () {
|
|||||||
Route::get('subjects/{subject}/student-scores', [StudentController::class, 'scores'])->name('student-scores');
|
Route::get('subjects/{subject}/student-scores', [StudentController::class, 'scores'])->name('student-scores');
|
||||||
Route::get('student-debts', [StudentController::class, 'debts'])->name('student-debts');
|
Route::get('student-debts', [StudentController::class, 'debts'])->name('student-debts');
|
||||||
Route::get('teachers/{teacher}/subjects', [SubjectTeacherController::class, 'index'])->name('teachers.subjects.index');
|
Route::get('teachers/{teacher}/subjects', [SubjectTeacherController::class, 'index'])->name('teachers.subjects.index');
|
||||||
Route::get('export-avg-scores', [StudentController::class, 'exportAvgScores'])->name('export-avg-scores');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user