#39 - generate timesheet #56

Merged
Baakoma merged 9 commits from #39-generate-timesheet into main 2022-02-21 16:09:45 +01:00
12 changed files with 1085 additions and 143 deletions

View File

@@ -4,9 +4,8 @@ declare(strict_types=1);
namespace Toby\Domain;
use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use Carbon\CarbonPeriod;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
use Toby\Domain\Enums\VacationRequestState;
use Toby\Eloquent\Helpers\YearPeriodRetriever;
@@ -20,33 +19,16 @@ class CalendarGenerator
) {
}
public function generate(YearPeriod $yearPeriod, string $month): array
public function generate(Carbon $month): array
{
$date = CarbonImmutable::create($yearPeriod->year, $this->monthNameToNumber($month));
$period = CarbonPeriod::create($date->startOfMonth(), $date->endOfMonth());
$period = CarbonPeriod::create($month->copy()->startOfMonth(), $month->copy()->endOfMonth());
$yearPeriod = YearPeriod::findByYear($month->year);
$holidays = $yearPeriod->holidays()->pluck("date");
return $this->generateCalendar($period, $holidays);
}
protected function monthNameToNumber($name): int
{
return match ($name) {
default => CarbonInterface::JANUARY,
"february" => CarbonInterface::FEBRUARY,
"march" => CarbonInterface::MARCH,
"april" => CarbonInterface::APRIL,
"may" => CarbonInterface::MAY,
"june" => CarbonInterface::JUNE,
"july" => CarbonInterface::JULY,
"august" => CarbonInterface::AUGUST,
"september" => CarbonInterface::SEPTEMBER,
"october" => CarbonInterface::OCTOBER,
"november" => CarbonInterface::NOVEMBER,
"december" => CarbonInterface::DECEMBER,
};
}
protected function generateCalendar(CarbonPeriod $period, Collection $holidays): array
{
$calendar = [];

View File

@@ -0,0 +1,53 @@
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
<?php
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
declare(strict_types=1);
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
namespace Toby\Domain\Enums;
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
use Carbon\CarbonInterface;
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
use Illuminate\Support\Carbon;
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
use Illuminate\Support\Str;
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
enum Month: string
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
{
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case January = "january";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case February = "february";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case March = "march";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case April = "april";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case May = "may";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case June = "june";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case July = "july";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case August = "august";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case September = "september";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case October = "october";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case November = "november";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
case December = "december";
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
public function toCarbonNumber(): int
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
{
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
return match ($this) {
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::January => CarbonInterface::JANUARY,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::February => CarbonInterface::FEBRUARY,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::March => CarbonInterface::MARCH,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::April => CarbonInterface::APRIL,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::May => CarbonInterface::MAY,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::June => CarbonInterface::JUNE,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::July => CarbonInterface::JULY,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::August => CarbonInterface::AUGUST,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::September => CarbonInterface::SEPTEMBER,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::October => CarbonInterface::OCTOBER,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::November => CarbonInterface::NOVEMBER,
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
self::December => CarbonInterface::DECEMBER,
krzysztofrewak commented 2022-02-21 15:32:49 +01:00 (Migrated from github.com)
Review
            static::January => CarbonInterface::JANUARY,
            static::February => CarbonInterface::FEBRUARY,
            static::March => CarbonInterface::MARCH,
            static::April => CarbonInterface::APRIL,
            static::May => CarbonInterface::MAY,
            static::June => CarbonInterface::JUNE,
            static::July => CarbonInterface::JULY,
            static::August => CarbonInterface::AUGUST,
            static::September => CarbonInterface::SEPTEMBER,
            static::October => CarbonInterface::OCTOBER,
            static::November => CarbonInterface::NOVEMBER,
            static::December => CarbonInterface::DECEMBER,
```suggestion static::January => CarbonInterface::JANUARY, static::February => CarbonInterface::FEBRUARY, static::March => CarbonInterface::MARCH, static::April => CarbonInterface::APRIL, static::May => CarbonInterface::MAY, static::June => CarbonInterface::JUNE, static::July => CarbonInterface::JULY, static::August => CarbonInterface::AUGUST, static::September => CarbonInterface::SEPTEMBER, static::October => CarbonInterface::OCTOBER, static::November => CarbonInterface::NOVEMBER, static::December => CarbonInterface::DECEMBER, ```
krzysztofrewak commented 2022-02-21 15:33:17 +01:00 (Migrated from github.com)
Review

Plus maybe some exception could be thrown on unknow value/default?

Plus maybe some exception could be thrown on unknow value/default?
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
Baakoma commented 2022-02-21 15:48:14 +01:00 (Migrated from github.com)
Review

image

![image](https://user-images.githubusercontent.com/16743001/154977581-bb213207-098b-4e9d-8feb-7d1b5c69e4e5.png)
};
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
}
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
public static function current(): Month
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
{
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
return Month::from(Str::lower(Carbon::now()->englishMonth));
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
}
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
public static function fromNameOrCurrent(string $name): Month
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
{
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
return Month::tryFrom($name) ?? Month::current();
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
}
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```
}
mtracz commented 2022-02-21 15:39:05 +01:00 (Migrated from github.com)
Review

I think we can simplify it:

        return Month::tryFrom($name) ?? Month::current();     
I think we can simplify it: ```suggestion return Month::tryFrom($name) ?? Month::current(); ```

View File

@@ -0,0 +1,37 @@
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
<?php
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
declare(strict_types=1);
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
namespace Toby\Domain;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Illuminate\Database\Eloquent\Collection;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Illuminate\Support\Carbon;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
use Toby\Eloquent\Models\User;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
class TimesheetExport implements WithMultipleSheets
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
protected Collection $users;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
protected Carbon $month;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
public function sheets(): array
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
return $this->users
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
->map(fn(User $user) => new TimesheetPerUserSheet($user, $this->month))
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
->toArray();
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
public function forUsers(Collection $users): static
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
$this->users = $users;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
return $this;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
public function forMonth(Carbon $month): static
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
{
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
$this->month = $month;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
return $this;
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?
}
krzysztofrewak commented 2022-02-21 15:33:37 +01:00 (Migrated from github.com)
Review

Why not to use map()?

Why not to use `map()`?

View File

@@ -0,0 +1,222 @@
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
<?php
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
declare(strict_types=1);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
namespace Toby\Domain;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Carbon\CarbonInterface;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Carbon\CarbonPeriod;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Generator;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Illuminate\Support\Carbon;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Illuminate\Support\Collection;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\FromGenerator;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\RegistersEventListeners;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithEvents;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithHeadings;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithStrictNullComparison;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithStyles;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Concerns\WithTitle;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Maatwebsite\Excel\Events\AfterSheet;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Shared\Date;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\Alignment;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\Border;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\Fill;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Domain\Enums\VacationRequestState;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Domain\Enums\VacationType;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Eloquent\Models\Holiday;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Eloquent\Models\User;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use Toby\Eloquent\Models\Vacation;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
class TimesheetPerUserSheet implements WithTitle, WithHeadings, WithEvents, WithStyles, WithStrictNullComparison, ShouldAutoSize, FromGenerator
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
use RegistersEventListeners;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected const HOURS_PER_DAY = 8;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected const START_HOUR = 8;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected const END_HOUR = 16;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function __construct(
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected User $user,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected Carbon $month,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function title(): string
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $this->user->fullName;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function headings(): array
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$types = VacationType::cases();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$headings = [
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Date"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Day of week"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Start date"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("End date"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Worked hours"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
];
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
foreach ($types as $type) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$headings[] = $type->label();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $headings;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function generator(): Generator
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$period = CarbonPeriod::create($this->month->copy()->startOfMonth(), $this->month->copy()->endOfMonth());
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$vacations = $this->getVacationsForPeriod($this->user, $period);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$holidays = $this->getHolidaysForPeriod($period);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
foreach ($period as $day) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$vacationsForDay = $vacations->get($day->toDateString(), new Collection());
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay = $this->checkIfWorkedThisDay($day, $holidays, $vacationsForDay);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$row = [
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
Date::dateTimeToExcel($day),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$day->translatedFormat("l"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay ? $this->toExcelTime(Carbon::createFromTime(static::START_HOUR)) : null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay ? $this->toExcelTime(Carbon::createFromTime(static::END_HOUR)) : null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$workedThisDay ? static::HOURS_PER_DAY : null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
];
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
foreach (VacationType::cases() as $type) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$row[] = $vacationsForDay->has($type->value) ? static::HOURS_PER_DAY : null;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
yield $row;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public function styles(Worksheet $sheet): void
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastRow = $sheet->getHighestRow();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastColumn = $sheet->getHighestColumn();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}1")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFont()->setBold(true);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}1")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setVertical(Alignment::VERTICAL_CENTER);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}1")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFill()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFillType(Fill::FILL_SOLID)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getStartColor()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setRGB("D9D9D9");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("C1:{$lastColumn}{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setHorizontal(Alignment::HORIZONTAL_CENTER);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A2:A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getNumberFormat()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFormatCode(NumberFormat::FORMAT_DATE_DDMMYYYY);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("C1:D{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getNumberFormat()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFormatCode(NumberFormat::FORMAT_DATE_TIME3);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A2:A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFont()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBold(true);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
for ($i = 2; $i < $lastRow; $i++) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$date = Date::excelToDateTimeObject($sheet->getCell("A{$i}")->getValue());
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
if (Carbon::createFromInterface($date)->isWeekend()) {
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A{$i}:{$lastColumn}{$i}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFill()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setFillType(Fill::FILL_SOLID)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getStartColor()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setRGB("FEE2E2");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getStyle("A1:{$lastColumn}{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAllBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBorderStyle(Border::BORDER_THIN)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getColor()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setRGB("B7B7B7");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
public static function afterSheet(AfterSheet $event): void
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet = $event->getSheet();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastRow = $sheet->getDelegate()->getHighestRow();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->append([
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
__("Sum:"),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
null,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
"=SUM(E2:E{$lastRow})",
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
]);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$lastRow++;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setHorizontal(Alignment::HORIZONTAL_RIGHT);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("A{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getFont()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBold(true);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("E{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAlignment()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setHorizontal(Alignment::HORIZONTAL_CENTER);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->mergeCells("A{$lastRow}:D{$lastRow}");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$sheet->getDelegate()->getStyle("A{$lastRow}:E{$lastRow}")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getAllBorders()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setBorderStyle(Border::BORDER_THIN)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->getColor()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->setRGB("B7B7B7");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function getVacationsForPeriod(User $user, CarbonPeriod $period): Collection
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $user->vacations()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->with("vacationRequest")
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->whereBetween("date", [$period->start, $period->end])
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->whereRelation("vacationRequest", "state", VacationRequestState::Approved->value)
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->get()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->groupBy(
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
[
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
fn(Vacation $vacation) => $vacation->date->toDateString(),
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
fn(Vacation $vacation) => $vacation->vacationRequest->type->value,
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
],
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function getHolidaysForPeriod(CarbonPeriod $period): Collection
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return Holiday::query()
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->whereBetween("date", [$period->start, $period->end])
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
->pluck("date");
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function toExcelTime(Carbon $time): float
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$excelTimestamp = Date::dateTimeToExcel($time);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
$excelDate = floor($excelTimestamp);
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $excelTimestamp - $excelDate;
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
protected function checkIfWorkedThisDay(CarbonInterface $day, Collection $holidays, Collection $vacations): bool
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
{
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
return $day->isWeekday() && $holidays->doesntContain($day) && $vacations->isEmpty();
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?
}
mtracz commented 2022-02-21 15:40:19 +01:00 (Migrated from github.com)
Review

Maybe move these hours to consts as start hour and end hour?

Maybe move these hours to consts as start hour and end hour?

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Controllers;
use Illuminate\Support\Carbon;
use Maatwebsite\Excel\Facades\Excel;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Toby\Domain\Enums\Month;
use Toby\Domain\TimesheetExport;
use Toby\Eloquent\Helpers\YearPeriodRetriever;
use Toby\Eloquent\Models\User;
class TimesheetController extends Controller
{
public function __invoke(Month $month, YearPeriodRetriever $yearPeriodRetriever): BinaryFileResponse
{
$yearPeriod = $yearPeriodRetriever->selected();
$carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber());
$users = User::query()
->orderBy("last_name")
->orderBy("first_name")
->get();
$filename = "{$carbonMonth->translatedFormat("F Y")}.xlsx";
$timesheet = (new TimesheetExport())
->forMonth($carbonMonth)
->forUsers($users);
return Excel::download($timesheet, $filename);
}
}

View File

@@ -4,11 +4,10 @@ declare(strict_types=1);
namespace Toby\Infrastructure\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
use Inertia\Response;
use Toby\Domain\CalendarGenerator;
use Toby\Domain\Enums\Month;
use Toby\Eloquent\Helpers\YearPeriodRetriever;
use Toby\Eloquent\Models\User;
use Toby\Infrastructure\Http\Resources\UserResource;
@@ -16,22 +15,25 @@ use Toby\Infrastructure\Http\Resources\UserResource;
class VacationCalendarController extends Controller
{
public function index(
Request $request,
YearPeriodRetriever $yearPeriodRetriever,
CalendarGenerator $calendarGenerator,
?string $month = null,
): Response {
$month = Str::lower($request->query("month", Carbon::now()->englishMonth));
$month = Month::fromNameOrCurrent((string)$month);
$yearPeriod = $yearPeriodRetriever->selected();
$carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber());
$users = User::query()
->orderBy("last_name")
->orderBy("first_name")
->get();
$calendar = $calendarGenerator->generate($yearPeriod, $month);
$calendar = $calendarGenerator->generate($carbonMonth);
return inertia("Calendar", [
"calendar" => $calendar,
"currentMonth" => $month,
"currentMonth" => $month->value,
"users" => UserResource::collection($users),
]);
}

View File

@@ -18,6 +18,7 @@
"laravel/telescope": "^4.6",
"laravel/tinker": "^2.5",
"lasserafn/php-initial-avatar-generator": "^4.2",
"maatwebsite/excel": "^3.1",
"spatie/laravel-google-calendar": "^3.5"
},
"require-dev": {

696
composer.lock generated
View File

@@ -4,64 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c0f36b87659921d0b7db0464b5d79ed5",
"content-hash": "09609461b05d589abb8bc0cbac9c653c",
"packages": [
{
"name": "asm89/stack-cors",
"version": "v2.1.1",
"source": {
"type": "git",
"url": "https://github.com/asm89/stack-cors.git",
"reference": "73e5b88775c64ccc0b84fb60836b30dc9d92ac4a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/asm89/stack-cors/zipball/73e5b88775c64ccc0b84fb60836b30dc9d92ac4a",
"reference": "73e5b88775c64ccc0b84fb60836b30dc9d92ac4a",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0",
"symfony/http-foundation": "^4|^5|^6",
"symfony/http-kernel": "^4|^5|^6"
},
"require-dev": {
"phpunit/phpunit": "^7|^9",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"autoload": {
"psr-4": {
"Asm89\\Stack\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alexander",
"email": "iam.asm89@gmail.com"
}
],
"description": "Cross-origin resource sharing library and stack middleware",
"homepage": "https://github.com/asm89/stack-cors",
"keywords": [
"cors",
"stack"
],
"support": {
"issues": "https://github.com/asm89/stack-cors/issues",
"source": "https://github.com/asm89/stack-cors/tree/v2.1.1"
},
"time": "2022-01-18T09:12:03+00:00"
},
{
"name": "azuyalabs/yasumi",
"version": "2.5.0",
@@ -709,6 +653,57 @@
],
"time": "2021-10-11T09:18:27+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.14.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
"reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
],
"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.14.0"
},
"time": "2021-12-25T01:21:49+00:00"
},
{
"name": "firebase/php-jwt",
"version": "v5.5.1",
@@ -768,25 +763,23 @@
},
{
"name": "fruitcake/laravel-cors",
"version": "v2.0.5",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-cors.git",
"reference": "3a066e5cac32e2d1cdaacd6b961692778f37b5fc"
"reference": "361d71f00a0eea8b74da26ae75d0d207c53aa5b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/3a066e5cac32e2d1cdaacd6b961692778f37b5fc",
"reference": "3a066e5cac32e2d1cdaacd6b961692778f37b5fc",
"url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/361d71f00a0eea8b74da26ae75d0d207c53aa5b3",
"reference": "361d71f00a0eea8b74da26ae75d0d207c53aa5b3",
"shasum": ""
},
"require": {
"asm89/stack-cors": "^2.0.1",
"fruitcake/php-cors": "^1",
"illuminate/contracts": "^6|^7|^8|^9",
"illuminate/support": "^6|^7|^8|^9",
"php": ">=7.2",
"symfony/http-foundation": "^4|^5|^6",
"symfony/http-kernel": "^4.3.4|^5|^6"
"php": ">=7.2"
},
"require-dev": {
"laravel/framework": "^6|^7.24|^8",
@@ -797,7 +790,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
},
"laravel": {
"providers": [
@@ -833,7 +826,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-cors/issues",
"source": "https://github.com/fruitcake/laravel-cors/tree/v2.0.5"
"source": "https://github.com/fruitcake/laravel-cors/tree/v2.1.0"
},
"funding": [
{
@@ -845,7 +838,78 @@
"type": "github"
}
],
"time": "2022-01-03T14:53:04+00:00"
"time": "2022-02-19T14:17:28+00:00"
},
{
"name": "fruitcake/php-cors",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/php-cors.git",
"reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruitcake/php-cors/zipball/58571acbaa5f9f462c9c77e911700ac66f446d4e",
"reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0",
"symfony/http-foundation": "^4.4|^5.4|^6"
},
"require-dev": {
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Fruitcake\\Cors\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fruitcake",
"homepage": "https://fruitcake.nl"
},
{
"name": "Barryvdh",
"email": "barryvdh@gmail.com"
}
],
"description": "Cross-origin resource sharing library for the Symfony HttpFoundation",
"homepage": "https://github.com/fruitcake/php-cors",
"keywords": [
"cors",
"laravel",
"symfony"
],
"support": {
"issues": "https://github.com/fruitcake/php-cors/issues",
"source": "https://github.com/fruitcake/php-cors/tree/v1.2.0"
},
"funding": [
{
"url": "https://fruitcake.nl",
"type": "custom"
},
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2022-02-20T15:07:15+00:00"
},
{
"name": "google/apiclient",
@@ -920,7 +984,7 @@
},
{
"name": "google/apiclient-services",
"version": "v0.235.0",
"version": "v0.236.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
@@ -958,7 +1022,7 @@
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.235.0"
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.236.0"
},
"time": "2022-02-07T14:04:26+00:00"
},
@@ -1437,12 +1501,12 @@
}
},
"autoload": {
"psr-4": {
"Inertia\\": "src"
},
"files": [
"./helpers.php"
]
],
"psr-4": {
"Inertia\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -2632,6 +2696,262 @@
},
"time": "2021-08-15T23:05:49+00:00"
},
{
"name": "maatwebsite/excel",
"version": "3.1.36",
"source": {
"type": "git",
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
"reference": "eb31f30d72c51c3fb11644b636945accbe50404f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/eb31f30d72c51c3fb11644b636945accbe50404f",
"reference": "eb31f30d72c51c3fb11644b636945accbe50404f",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/support": "5.8.*|^6.0|^7.0|^8.0|^9.0",
"php": "^7.0|^8.0",
"phpoffice/phpspreadsheet": "^1.18"
},
"require-dev": {
"orchestra/testbench": "^6.0|^7.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.36"
},
"funding": [
{
"url": "https://laravel-excel.com/commercial-support",
"type": "custom"
},
{
"url": "https://github.com/patrickbrouwers",
"type": "github"
}
],
"time": "2022-01-27T18:34:20+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58",
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58",
"shasum": ""
},
"require": {
"myclabs/php-enum": "^1.5",
"php": ">= 7.1",
"psr/http-message": "^1.0",
"symfony/polyfill-mbstring": "^1.0"
},
"require-dev": {
"ext-zip": "*",
"guzzlehttp/guzzle": ">= 6.3",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": ">= 7.5"
},
"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/master"
},
"funding": [
{
"url": "https://opencollective.com/zipstream",
"type": "open_collective"
}
],
"time": "2020-05-30T13:11:16+00:00"
},
{
"name": "markbaker/complex",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "ab8bc271e404909db09ff2d5ffa1e538085c0f22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/ab8bc271e404909db09ff2d5ffa1e538085c0f22",
"reference": "ab8bc271e404909db09ff2d5ffa1e538085c0f22",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
"squizlabs/php_codesniffer": "^3.4"
},
"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.1"
},
"time": "2021-06-29T15:32:53+00:00"
},
{
"name": "markbaker/matrix",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "c66aefcafb4f6c269510e9ac46b82619a904c576"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/c66aefcafb4f6c269510e9ac46b82619a904c576",
"reference": "c66aefcafb4f6c269510e9ac46b82619a904c576",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.4"
},
"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.0"
},
"time": "2021-07-01T19:01:15+00:00"
},
{
"name": "meyfa/php-svg",
"version": "v0.9.1",
@@ -2781,6 +3101,66 @@
],
"time": "2021-10-01T21:08:31+00:00"
},
{
"name": "myclabs/php-enum",
"version": "1.8.3",
"source": {
"type": "git",
"url": "https://github.com/myclabs/php-enum.git",
"reference": "b942d263c641ddb5190929ff840c68f78713e937"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937",
"reference": "b942d263c641ddb5190929ff840c68f78713e937",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.3 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "1.*",
"vimeo/psalm": "^4.6.2"
},
"type": "library",
"autoload": {
"psr-4": {
"MyCLabs\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP Enum contributors",
"homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
}
],
"description": "PHP Enum implementation",
"homepage": "http://github.com/myclabs/php-enum",
"keywords": [
"enum"
],
"support": {
"issues": "https://github.com/myclabs/php-enum/issues",
"source": "https://github.com/myclabs/php-enum/tree/1.8.3"
},
"funding": [
{
"url": "https://github.com/mnapoli",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
"type": "tidelift"
}
],
"time": "2021-07-05T08:18:36+00:00"
},
{
"name": "nesbot/carbon",
"version": "2.57.0",
@@ -3360,6 +3740,110 @@
},
"time": "2021-12-17T14:08:35+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.22.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "3a9e29b4f386a08a151a33578e80ef1747037a48"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/3a9e29b4f386a08a151a33578e80ef1747037a48",
"reference": "3a9e29b4f386a08a151a33578e80ef1747037a48",
"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.13",
"maennchen/zipstream-php": "^2.1",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": "^7.3 || ^8.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"dompdf/dompdf": "^1.0",
"friendsofphp/php-cs-fixer": "^3.2",
"jpgraph/jpgraph": "^4.0",
"mpdf/mpdf": "8.0.17",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"squizlabs/php_codesniffer": "^3.6",
"tecnickcom/tcpdf": "^6.4"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)",
"jpgraph/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 (doesn't yet support PHP8)"
},
"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.22.0"
},
"time": "2022-02-18T12:57:07+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.8.1",
@@ -3906,25 +4390,25 @@
},
{
"name": "psr/simple-cache",
"version": "3.0.0",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
"dev-master": "1.0.x-dev"
}
},
"autoload": {
@@ -3939,7 +4423,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
@@ -3951,9 +4435,9 @@
"simple-cache"
],
"support": {
"source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
"source": "https://github.com/php-fig/simple-cache/tree/master"
},
"time": "2021-10-29T13:26:27+00:00"
"time": "2017-10-23T01:57:42+00:00"
},
{
"name": "psy/psysh",
@@ -7445,16 +7929,16 @@
},
{
"name": "phar-io/version",
"version": "3.1.1",
"version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
"reference": "15a90844ad40f127afd244c0cad228de2a80052a"
"reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/15a90844ad40f127afd244c0cad228de2a80052a",
"reference": "15a90844ad40f127afd244c0cad228de2a80052a",
"url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
"shasum": ""
},
"require": {
@@ -7490,9 +7974,9 @@
"description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
"source": "https://github.com/phar-io/version/tree/3.1.1"
"source": "https://github.com/phar-io/version/tree/3.2.1"
},
"time": "2022-02-07T21:56:48+00:00"
"time": "2022-02-21T01:04:05+00:00"
},
{
"name": "php-webdriver/webdriver",
@@ -7788,16 +8272,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.10",
"version": "9.2.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "d5850aaf931743067f4bfc1ae4cbd06468400687"
"reference": "665a1ac0a763c51afc30d6d130dac0813092b17f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687",
"reference": "d5850aaf931743067f4bfc1ae4cbd06468400687",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/665a1ac0a763c51afc30d6d130dac0813092b17f",
"reference": "665a1ac0a763c51afc30d6d130dac0813092b17f",
"shasum": ""
},
"require": {
@@ -7853,7 +8337,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.11"
},
"funding": [
{
@@ -7861,7 +8345,7 @@
"type": "github"
}
],
"time": "2021-12-05T09:12:13+00:00"
"time": "2022-02-18T12:46:09+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -8106,16 +8590,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.13",
"version": "9.5.14",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "597cb647654ede35e43b137926dfdfef0fb11743"
"reference": "1883687169c017d6ae37c58883ca3994cfc34189"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743",
"reference": "597cb647654ede35e43b137926dfdfef0fb11743",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1883687169c017d6ae37c58883ca3994cfc34189",
"reference": "1883687169c017d6ae37c58883ca3994cfc34189",
"shasum": ""
},
"require": {
@@ -8193,7 +8677,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.14"
},
"funding": [
{
@@ -8205,7 +8689,7 @@
"type": "github"
}
],
"time": "2022-01-24T07:33:35+00:00"
"time": "2022-02-18T12:54:07+00:00"
},
{
"name": "sebastian/cli-parser",
@@ -9299,16 +9783,16 @@
},
{
"name": "spatie/ignition",
"version": "1.0.4",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/spatie/ignition.git",
"reference": "617c41d1bf675d95a7bd9adc826ba93d43affe7f"
"reference": "6b7bb804f4834b080f5ac941f6ac6800a485011e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/ignition/zipball/617c41d1bf675d95a7bd9adc826ba93d43affe7f",
"reference": "617c41d1bf675d95a7bd9adc826ba93d43affe7f",
"url": "https://api.github.com/repos/spatie/ignition/zipball/6b7bb804f4834b080f5ac941f6ac6800a485011e",
"reference": "6b7bb804f4834b080f5ac941f6ac6800a485011e",
"shasum": ""
},
"require": {
@@ -9366,7 +9850,7 @@
"type": "github"
}
],
"time": "2022-02-16T09:02:42+00:00"
"time": "2022-02-17T21:40:47+00:00"
},
{
"name": "spatie/laravel-ignition",

104
config/excel.php Normal file
View File

@@ -0,0 +1,104 @@
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
<?php
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
declare(strict_types=1);
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
use Maatwebsite\Excel\DefaultValueBinder;
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
use Maatwebsite\Excel\Excel;
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
return [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"exports" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"chunk_size" => 1000,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"pre_calculate_formulas" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"strict_null_comparison" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"csv" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"delimiter" => ",",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"enclosure" => '"',
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"line_ending" => PHP_EOL,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"use_bom" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"include_separator_line" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"excel_compatibility" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"output_encoding" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"properties" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"creator" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"lastModifiedBy" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"title" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"description" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"subject" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"keywords" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"category" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"manager" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"company" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"imports" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"read_only" => true,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"ignore_empty" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"heading_row" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"formatter" => "slug",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"csv" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"delimiter" => ",",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"enclosure" => '"',
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"escape_character" => "\\",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"contiguous" => false,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"input_encoding" => "UTF-8",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"properties" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"creator" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"lastModifiedBy" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"title" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"description" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"subject" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"keywords" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"category" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"manager" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"company" => "",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"extension_detector" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xlsx" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xlsm" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xltx" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xltm" => Excel::XLSX,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xls" => Excel::XLS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xlt" => Excel::XLS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"ods" => Excel::ODS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"ots" => Excel::ODS,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"slk" => Excel::SLK,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"xml" => Excel::XML,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"gnumeric" => Excel::GNUMERIC,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"htm" => Excel::HTML,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"html" => Excel::HTML,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"csv" => Excel::CSV,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"tsv" => Excel::TSV,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"pdf" => Excel::DOMPDF,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"value_binder" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"default" => DefaultValueBinder::class,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"cache" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"driver" => "memory",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"batch" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"memory_limit" => 60000,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"illuminate" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"store" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"transactions" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"handler" => "db",
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"db" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"connection" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"temporary_files" => [
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"local_path" => storage_path("framework/cache/laravel-excel"),
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"remote_disk" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"remote_prefix" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
"force_resync_remote" => null,
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
],
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.
];
krzysztofrewak commented 2022-02-21 15:34:57 +01:00 (Migrated from github.com)
Review

I would import that too.

I would import that too.

View File

@@ -1,10 +1,20 @@
<template>
<InertiaHead title="Kalendarz urlopów" />
<div class="bg-white shadow-md">
<div class="p-4 sm:px-6">
<h2 class="text-lg leading-6 font-medium text-gray-900">
Kalendarz urlopów
</h2>
<div class="flex justify-between items-center p-4 sm:px-6">
<div>
<h2 class="text-lg leading-6 font-medium text-gray-900">
Kalendarz urlopów
</h2>
</div>
<div>
<a
:href="`/timesheet/${selectedMonth.value}`"
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
>
Pobierz plik excel
</a>
</div>
</div>
<div class="overflow-x-auto">
<table class="w-full text-center table-fixed text-sm border border-gray-300">
@@ -19,7 +29,7 @@
<MenuButton
class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
>
{{ selectedMonth.name }}
{{ selectedMonth.name }} {{ years.current }}
<ChevronDownIcon class="-mr-1 ml-2 h-5 w-5" />
</MenuButton>
</div>
@@ -42,8 +52,7 @@
v-slot="{ active }"
>
<InertiaLink
href="/vacation-calendar"
:data="{ month: month.value }"
:href="`/vacation-calendar/${month.value}`"
:class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'flex w-full font-normal px-4 py-2 text-sm']"
>
{{ month.name }}
@@ -151,6 +160,10 @@ export default {
type: String,
default: () => 'january',
},
years: {
type: Object,
default: () => null,
},
},
setup(props) {
const {getMonths, findMonth} = useMonthInfo()

View File

@@ -45,6 +45,12 @@
"Vacation request has been approved.": "Wniosek urlopowy został zatwierdzony.",
"Vacation request has been rejected.": "Wniosek urlopowy został odrzucony.",
"Vacation request has been cancelled.": "Wniosek urlopowy został anulowany.",
"Sum:": "Suma:",
"Date": "Data",
"Day of week": "Dzień tygodnia",
"Start date": "Data rozpoczecia",
"End date": "Data zakończenia",
"Worked hours": "Ilość godzin",
"Hi :user!": "Cześć :user!",
"The vacation request :title has changed state to :state.": "Wniosek urlopowy :title zmienił status na :state.",
"Vacation request :title": "Wniosek urlopowy :title",

View File

@@ -7,6 +7,7 @@ use Toby\Infrastructure\Http\Controllers\GoogleController;
use Toby\Infrastructure\Http\Controllers\HolidayController;
use Toby\Infrastructure\Http\Controllers\LogoutController;
use Toby\Infrastructure\Http\Controllers\SelectYearPeriodController;
use Toby\Infrastructure\Http\Controllers\TimesheetController;
use Toby\Infrastructure\Http\Controllers\UserController;
use Toby\Infrastructure\Http\Controllers\VacationCalendarController;
use Toby\Infrastructure\Http\Controllers\VacationLimitController;
@@ -24,8 +25,10 @@ Route::middleware("auth")->group(function (): void {
Route::get("/vacation-limits", [VacationLimitController::class, "edit"])
->name("vacation.limits");
Route::get("/vacation-calendar", [VacationCalendarController::class, "index"])
Route::get("/vacation-calendar/{month?}", [VacationCalendarController::class, "index"])
->name("vacation.calendar");
Route::get("/timesheet/{month}", TimesheetController::class)
->name("timesheet");
Route::get("/vacation-limits", [VacationLimitController::class, "edit"])->name("vacation.limits");
Route::put("/vacation-limits", [VacationLimitController::class, "update"]);