* test * #48 - deployment * #48 - fixes * #48 - prod assets * #48 - readme for heroku deployment * #48 - fix * #48 - ecs fix * #48 - fix * #48 - fix * #48 - cr fix * #48 - remove predis dependency
This commit is contained in:
@@ -4,19 +4,19 @@ declare(strict_types=1);
|
||||
|
||||
namespace Toby\Eloquent\Observers;
|
||||
|
||||
use Toby\Eloquent\Helpers\YearPeriodRetriever;
|
||||
use Toby\Eloquent\Models\User;
|
||||
use Toby\Eloquent\Models\YearPeriod;
|
||||
|
||||
class UserObserver
|
||||
{
|
||||
public function __construct(
|
||||
protected YearPeriodRetriever $yearPeriodRetriever,
|
||||
) {}
|
||||
|
||||
public function created(User $user): void
|
||||
{
|
||||
$user->vacationLimits()->create([
|
||||
"year_period_id" => $this->yearPeriodRetriever->current()->id,
|
||||
]);
|
||||
$yearPeriods = YearPeriod::all();
|
||||
|
||||
foreach ($yearPeriods as $yearPeriod) {
|
||||
$user->vacationLimits()->create([
|
||||
"year_period_id" => $yearPeriod->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class DashboardController extends Controller
|
||||
|
||||
$holidays = Holiday::query()
|
||||
->whereDate("date", ">=", $now)
|
||||
->latest()
|
||||
->orderBy("date")
|
||||
->limit(3)
|
||||
->get();
|
||||
|
||||
|
@@ -9,12 +9,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
protected $proxies;
|
||||
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
protected $proxies = "*";
|
||||
protected $headers = Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
|
Reference in New Issue
Block a user