Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"require": {
"php": ">=8.1",
"roots/acorn": "^4.3",
"sentry/sentry-laravel": "^4.4"
"sentry/sentry-laravel": "^4.4",
"spatie/laravel-csp": "^2.10"
},
"require-dev": {
"larastan/larastan": "^2.9",
Expand Down
151 changes: 147 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/Http/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Yard\Nutshell\Http;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Routing\Router;
use Roots\Acorn\Http\Kernel as AcornKernel;

class Kernel extends AcornKernel
{
public function __construct(Application $app, Router $router)
{
parent::__construct($app, $router);
$this->middleware[] = \Spatie\Csp\AddCspHeaders::class;
}
}
5 changes: 5 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ function bootloader(): Bootloader
\Yard\Nutshell\Console\Kernel::class
);

$bootloader->getApplication()->bind(
\Roots\Acorn\Http\Kernel::class,
\Yard\Nutshell\Http\Kernel::class
);

$bootloader->getApplication()->bind(
\Roots\Acorn\Exceptions\Handler::class,
\Yard\Nutshell\Exceptions\Handler::class
Expand Down