GithubHelp home page GithubHelp logo

spatie / laravel-ignition Goto Github PK

View Code? Open in Web Editor NEW
440.0 5.0 65.0 3.88 MB

A beautiful error page for Laravel apps

Home Page: https://flareapp.io/ignition

License: MIT License

PHP 99.46% Blade 0.54%
php error-handling laravel

laravel-ignition's Introduction

Ignition: a beautiful error page for Laravel apps

Latest Version on Packagist Tests Total Downloads

Ignition is a beautiful and customizable error page for Laravel applications. It is the default error page for new Laravel applications. It also allows to publicly share your errors on Flare. If configured with a valid Flare API key, your errors in production applications will be tracked, and you'll get notified when they happen.

spatie/laravel-ignition works for Laravel 8 and 9 applications running on PHP 8.0 and above. Looking for Ignition for Laravel 5.x, 6.x or 7.x or old PHP versions? facade/ignition is still compatible.

Screenshot of ignition

Are you a visual learner?

In this video on YouTube, you'll see a demo of all of the features.

Do know more about the design decisions we made, read this blog post.

Official Documentation

The official documentation for Ignition can be found on the Flare website.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-ignition's People

Contributors

adrianmrn avatar alexvanderbist avatar amaelftah avatar ankurk91 avatar carlobeltrame avatar coquer avatar dependabot[bot] avatar driesvints avatar erikn69 avatar freekmurze avatar github-actions[bot] avatar grahamcampbell avatar gummibeer avatar jessarcher avatar jubeki avatar kudashevs avatar laravel-shift avatar mikaelpopowicz avatar mpociot avatar mrrio avatar musa11971 avatar nunomaduro avatar patinthehat avatar riasvdv avatar rubenvanassche avatar sebastiandedeyne avatar stayallive avatar synchro avatar timvandijck avatar willemvb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-ignition's Issues

Compatibility issues with TronLink extension

  • Laravel Version: 9.3.1
  • PHP Version: 8.0.15
  • Database Driver & Version: mysql, 5.7.33
  • Google Cgrome: 99.0.4844.51

Hello. When I get an error in Laravel, when I scroll the page or click on any of the links on the error page, the page appears as follows.

ignition 00_00_00-00_00_30

The browser console also shows this error !!

issue

Laravel Debugbar issue

"spatie/laravel-ignition": "1.0.2",
PHP 8.1.2
Laravel 8.81.0
"barryvdh/laravel-debugbar": "3.6.6",

Most of the time when I get an error, it is not displayed because It gets stuck with the Laravel debugbar.

Cannot assign Barryvdh\Debugbar\DebugbarViewEngine to property Spatie\LaravelIgnition\Views\ViewExceptionMapper::$compilerEngine of type Illuminate\View\Engines\CompilerEngine

Example:
https://flareapp.io/share/87nzGkd7#F55

Tweak to the Laravel 8 Install Doc

In the docs for Laravel 8 you have to swap out the composer dependency
Screenshot_20220128_084934

However, Laravel 8 out of the box has the old Ignition as around 2.5

"facade/ignition": "^2.5",

Whereas this version is around ^1.0. This will cause a composer error if you just change the name.

So just to make it more clear you might want to add something that shows swapping that

"spatie/laravel-ignition": "^1.0"

Ignition Settings Dropdown

Hey - I love the new ignition, it is awesome!

Just one thing I spotted though, on Chrome, in dark mode, when selecting an IDE in the ignition settings, the text colour seems to be the same as the dropdown background making it a bit hard to see the other options.

image

Doesn't show previous thrown exception

Title.

Once an exception is catched, and contains a previously thrown exception, there is no UI or log for that previous exception.

The only way to retrieve it is manually editing the code.

Error page does not work

  • Laravel Version: 9.2.0
  • PHP Version: 8.1.3
  • Database Driver & Version: N\A

Description:

Ignition html error page does not work in both Insomnia preview mode and thunder client preview mode.
It works only in browser.

Steps To Reproduce:

I have created a live endpoint so that you can understand the issue.
https://insomnia-open-source.imithu.org/api/test
open this endpoint in,

  • any latest browser
  • insomnia

I hope, you have found the error.

Relation

React Rendering Error when report 'context' contains a user with a non-numeric keys array property

I've noticed that Ignition error page becomes blank when I log in to my project, and a browser console error from ReactJS appers; error details:

https://reactjs.org/docs/error-decoder.html/?invariant=31&args

After some debugging, I've found that the error was because "Spatie Laravel Translatable" package converts the translated model attributes of the logged-in user into an array with string keys that correspond to the available locales like:

['en' => 'some string', 'ar' => 'some translated string']

And when those properties are encoded into JSON, they become Objects not arrays causing rendering issue in the error page.

Symfony Error - Target class [Spatie\LaravelIgnition\Renderers\IgnitionExceptionRenderer] does not exist.

With the switchover to laravel-ignition, instead of getting the actual error message, I am receiving the below when we're throwing an Exception early in our code flow. In this particular case, it is due to a MySQL server issue, but I wouldnt know that since we're getting the below error.

Target class [Spatie\LaravelIgnition\Renderers\IgnitionExceptionRenderer] does not exist.

This is using Laravel 9 and latest laravel-ignition package. I have removed clockwork as well, just in case.

Any suggestions here, as I do not see any particular code that affects that, but maybe something is missing.

Console warning when throwing test exception

After upgrading from Laravel 8 to 9 I'm getting a console warning when throwing a test exception.

  • Laravel Version: 9.0
  • PHP Version: 8.0.10/8.1.2
  • Ignition Version: spatie/laravel-ignition 1.0

admin:215 Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Xc`. See https://reactjs.org/link/warning-keys for more information.
    at Xc (http://mysite.local/admin:215:581601)
    at Jc (http://mysite.local/admin:215:583586)
    at div
    at es (http://mysite.local/admin:215:538133)
    at div
    at $c (http://mysite.local/admin:215:580128)
    at es (http://mysite.local/admin:215:538133)
    at Zc (http://mysite.local/admin:215:584093)
    at section
    at rm (http://mysite.local/admin:215:660887)
    at main
    at ye (http://mysite.local/admin:215:307426)
    at Ie (http://mysite.local/admin:215:308955)
    at es (http://mysite.local/admin:215:538133)
    at om (http://mysite.local/admin:215:662493)

Runnable Solutions not working in upgraded Legacy-Laravel Apps because of `$namespace`

My company has a Laravel app that was created around the 4.x/5.0 stage of Laravel.

The upgrades have always been performed correctly according to the upgrade-guides.

However I noticed, runnable solutions weren't working in this application, while they were in the new ones I created.

After digging for quite a while, I realized, this was due to the (in 9.x no longer existent) $namespace property of App\Providers\RouteServiceProvider.
Having this set, causes a silently caught Exception in Spatie\LaravelIgnition\Solutions\SolutionTransformers\LaravelSolutionTransformer::executeEndpoint because it tries to construct a Laravel-Controller from Spatie\LaravelIgnition\Http\Controllers\ExecuteSolutionController.

But if the $namespace is e.g. set to protected $namespace = 'App\Http\Controllers'; it tries to construct the Controller App\Http\Controllers\Spatie\LaravelIgnition\Http\Controllers\ExecuteSolutionController. This one doesn't exist for obvious reasons.

I'm no expert in constructing Laravel-Controllers in packages, if it is maybe possible to ignore the Namespace-overwrite in a package (would make sense, but I couldn't find an option to force the $namespace to be ignored).

If this can be fixed without too much work this is obviously preferable, otherwise this needs to definitely be mentioned in the Installation steps for this package in apps apart from default Laravel instances. It isn't even that hard to work around some old applications LIKE HERE, if you are aware of it.

Move ignition & flare to same error UI

Type error in package discovery

Laravel 8.80.0 with PHP 8.0.14.
Manually deleted "bootstrap\cache\packages.php" because it was still trying to find facade\ignition.

Very excited to see new Ignition, but it didn't install:
Last part of composer update after changing composer.json:
"spatie/laravel-ignition": "^1.0",

  • Installing spatie/backtrace (1.2.1): Extracting archive
  • Installing spatie/flare-client-php (1.0.0): Extracting archive
  • Installing spatie/ignition (1.0.1): Extracting archive
  • Installing spatie/laravel-ignition (1.0.0): Extracting archive
    C:\inetpub\TSMS> @php artisan vendor:publish --tag=laravel-assets --ansi

TypeError

Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in C:\inetpub\TSMS\vendor\spatie\laravel-ignition\src\IgnitionServiceProvider.php on line 162

at C:\inetpub\TSMS\vendor\spatie\laravel-ignition\src\Recorders\QueryRecorder\QueryRecorder.php:19
15▕ protected bool $reportBindings = true;
16▕
17▕ protected ?int $maxQueries;
18▕
➜ 19▕ public function __construct(
20▕ Application $app,
21▕ bool $reportBindings = true,
22▕ ?int $maxQueries = null
23▕ ) {

1 C:\inetpub\TSMS\vendor\spatie\laravel-ignition\src\IgnitionServiceProvider.php:162
Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder::__construct(Object(Illuminate\Foundation\Application))

2 C:\inetpub\TSMS\vendor\laravel\framework\src\Illuminate\Container\Container.php:873
Spatie\LaravelIgnition\IgnitionServiceProvider::Spatie\LaravelIgnition{closure}(Object(Illuminate\Foundation\Application), [])

Editor Menu not readable in Dark Mode

Picture shows it:
image

when using theme auto (with preferred design set to dark in windows) or dark in ignition, select Editor in ignition settings isn't readable

one solution could be

.dark #editor-select option {
    color: #000;
}

Send shareable error report to front

As agreed in the call from last week (or maybe 2 weeks ago?), we'll still create the shareable error report in the backend and append this to the end of the ignition HTML.

This will ensure that the ignition page can still be rendered as fast as possible, and that we don't have to copy over all the stripping logic to JS.

You can just add it as a comment in the blade here, and I'll make sure it finds its way to the share component in React 👍
https://github.com/spatie/ignition/blob/68a6b91eb7e2592239a552dfb85768a8b1a2c925/resources/views/errorPage.php#L50

Git information should not fail

image

I think that it should not critically fail because of git, also 60 sec timeout seems a bit much.
What's your opinion on this?

This happens because I run the project from a NFS share, and there are a lot of files.
Ideally I can live without git information if it causes a long waiting time and or crashes.

Solutions cannot be run from your current IP address.

I came across this error a lot today but am unsure what it means for my Amazon EC2 server. Any ideas?

Laravel: 9.4.1
PHP: 8.1
spatie/ignition: 1.2.3
spatie/laravel-ignition: 1.0.6

2022-03-09 16:38:00] local.ERROR: Solutions cannot be run from your current IP address. {"exception":"[object] (Spatie\LaravelIgnition\Exceptions\CannotExecuteSolutionForNonLocalIp(code: 0): Solutions cannot be run from your current IP address. at /var/www/html/vendor/spatie/laravel-ignition/src/Exceptions/CannotExecuteSolutionForNonLocalIp.php:14)
[stacktrace]
#0 /var/www/html/vendor/spatie/laravel-ignition/src/Http/Controllers/ExecuteSolutionController.php(48): Spatie\LaravelIgnition\Exceptions\CannotExecuteSolutionForNonLocalIp::make()
#1 /var/www/html/vendor/spatie/laravel-ignition/src/Http/Controllers/ExecuteSolutionController.php(21): Spatie\LaravelIgnition\Http\Controllers\ExecuteSolutionController->ensureLocalRequest()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(48): Spatie\LaravelIgnition\Http\Controllers\ExecuteSolutionController->__invoke()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\Routing\ControllerDispatcher->dispatch()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\Routing\Route->runController()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\Routing\Route->run()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#7 /var/www/html/vendor/spatie/laravel-ignition/src/Http/Middleware/RunnableSolutionsEnabled.php(15): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Spatie\LaravelIgnition\Http\Middleware\RunnableSolutionsEnabled->handle()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(727): Illuminate\Pipeline\Pipeline->then()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(702): Illuminate\Routing\Router->runRouteWithinStack()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(666): Illuminate\Routing\Router->runRoute()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(655): Illuminate\Routing\Router->dispatchToRoute()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()

window.ignite is not a function

I'm developping a laravel project with Metronic 8 theme
Since I upgraded to Laravel 9 from the last version of Laravel 8, when I get an error I have an empty page with errors on the console.

First an
Uncaught SyntaxError: Unexpected token '{'

Which is due to the last line of this block of code

* Validation function for `value` and `defaultValue`.
 */function checkSelectPropTypes(props){{checkControlledValueProps('select',props);for(var i=0;i<valuePropNames.length;i++){var propName=valuePropNames[i];if(props[propName]==null){continue;}var isArray=Array.isArray(props[propName]);if(props.multiple&&!isArray){error('The `%s` prop supplied to <select> must be an array if '+'`multiple` is true.%s',propName,getDeclarationErrorAddendum());}else if(!props.multiple&&isArray){error('The `%s` prop supplied to <select> must be a scalar '+'value if `multiple` is false.%s',propName,getDeclarationErrorAddendum());}}}}function updateOptions(node,multiple,propValue,setDefaultSelected){var options=node.options;if(multiple){var selectedValues=propValue;var selectedValue={};for(var i=0;i<selectedValues.length;i++){// Prefix to avoid chaos with special keys.
selectedValue['$'+selectedValues[i]]=true;}for(var _i=0;_i<options.length;_i++){var selected {// Do not set `select.value` as exact behavior isn't consistent across all

and an error
window.ignite is not a function

When I remove the package from my project, I get the default symfony error page without problem. Did I miss something when I installed the laravel-ignition package ?

Version: 1.0.6
Php: 8.0.6
Laravel: 9.1

TypeError: Cannot read properties of undefined (reading 'slice')

  • Version: 1.0.10
  • Laravel: 9.5

Some queries can not be displayed on SQL error panel. On SQL panel expand, the UI return this error:

TypeError: Cannot read properties of undefined (reading 'slice')
    at parseKey (https://localhost/accesorios-triumph:192:289988)
    at e.value (https://localhost/accesorios-triumph:192:290615)
    at e.value (https://localhost/accesorios-triumph:192:289881)
    at e.value (https://localhost/accesorios-triumph:192:289703)
    at e.value (https://localhost/accesorios-triumph:192:288687)
    at e.value (https://localhost/accesorios-triumph:192:288333)
    at m.value (https://localhost/accesorios-triumph:192:278275)
    at Object.t.format (https://localhost/accesorios-triumph:192:350472)
    at jh (https://localhost/accesorios-triumph:192:353361)
    at ci (https://localhost/accesorios-triumph:192:70413)

Tested in chrome on incognito mode without any extension enabled:

Peek 2022-03-18 12-28

Blade template not resolved

Hello,

When an exception is thrown inside a view, the compiled cache view is shown instead of the initial blade template.

Is this the intended behaviour?

image

Thanks,
Karel

Large SQL lines are not visible on SQL error panel

  • Version: 1.0.10
  • Laravel: 9.5

I have some SQL queries with large table names and columns and when a error occurs, the SQL is not fully visible on the right.

Screenshot from 2022-03-17 18-47-27

Maybe adding a overflow: auto to layer?

Thanks!

Igniton page throws error showing default symfony error page

``After updating a project from git to a new PC and installing all dependencies when I get any error(DB, Type, Exceptions) instead of seeing the iginition page I see this page with the same error.

Using laravel 9.2.0, Iginition 1.0.6

image

I tried reinstalling all the vendor folder and updating to the latest version.

Composer dependencies:

"require": {
    "php": "^8.1",
    "fruitcake/laravel-cors": "^2.0.5",
    "guzzlehttp/guzzle": "^7.2",
    "inertiajs/inertia-laravel": "^0.5.2",
    "laravel/framework": "^9.0",
    "laravel/jetstream": "^2.6",
    "laravel/sanctum": "^2.14",
    "laravel/tinker": "^2.7",
    "tightenco/ziggy": "^1.0"
},
"require-dev": {
    "barryvdh/laravel-debugbar": "^3.6",
    "barryvdh/laravel-ide-helper": "^2.12",
    "fakerphp/faker": "^1.9.1",
    "laravel/sail": "^1.0.1",
    "mockery/mockery": "^1.4.4",
    "nunomaduro/collision": "^6.1",
    "phpunit/phpunit": "^9.5.10",
    "spatie/laravel-ignition": "^1.0"
},

Stack trace:

TypeError:
Spatie\FlareClient\Flare::setStage(): Argument #1 ($stage) must be of type string, null given, called in C:\xampp\htdocs\haifa\vendor\spatie\laravel-ignition\src\IgnitionServiceProvider.php on line 123

  at C:\xampp\htdocs\haifa\vendor\spatie\flare-client-php\src\Flare.php:88
  at Spatie\FlareClient\Flare->setStage(null)
     (C:\xampp\htdocs\haifa\vendor\spatie\laravel-ignition\src\IgnitionServiceProvider.php:123)
  at Spatie\LaravelIgnition\IgnitionServiceProvider->Spatie\LaravelIgnition\{closure}(object(Application), array())
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Container\Container.php:873)
  at Illuminate\Container\Container->build(object(Closure))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Container\Container.php:758)
  at Illuminate\Container\Container->resolve('Spatie\\FlareClient\\Flare', array(), true)
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:855)
  at Illuminate\Foundation\Application->resolve('Spatie\\FlareClient\\Flare', array())
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Container\Container.php:694)
  at Illuminate\Container\Container->make('Spatie\\FlareClient\\Flare', array())
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:840)
  at Illuminate\Foundation\Application->make('Spatie\\FlareClient\\Flare', array())
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php:119)
  at app('Spatie\\FlareClient\\Flare')
     (C:\xampp\htdocs\haifa\vendor\spatie\laravel-ignition\src\Renderers\ErrorPageRenderer.php:22)
  at Spatie\LaravelIgnition\Renderers\ErrorPageRenderer->render(object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\spatie\laravel-ignition\src\Renderers\IgnitionExceptionRenderer.php:20)
  at Spatie\LaravelIgnition\Renderers\IgnitionExceptionRenderer->render(object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:559)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionWithCustomRenderer(object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:544)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionContent(object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:528)
  at Illuminate\Foundation\Exceptions\Handler->convertExceptionToResponse(object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:507)
  at Illuminate\Foundation\Exceptions\Handler->prepareResponse(object(Request), object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:421)
  at Illuminate\Foundation\Exceptions\Handler->renderExceptionResponse(object(Request), object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php:341)
  at Illuminate\Foundation\Exceptions\Handler->render(object(Request), object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:427)
  at Illuminate\Foundation\Http\Kernel->renderException(object(Request), object(ParseError))
     (C:\xampp\htdocs\haifa\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:115)
  at Illuminate\Foundation\Http\Kernel->handle(object(Request))
     (C:\xampp\htdocs\haifa\public\index.php:52)

Conflict between Sentry and Ignition

Not sure if this is your issue or a Sentry specific issue, but it wasn't a problem previously with the older version.

The reported error we're seeing is Cannot assign Sentry\Laravel\Tracing\ViewEngineDecorator to property Spatie\LaravelIgnition\Views\ViewExceptionMapper::$compilerEngine of type Illuminate\View\Engines\CompilerEngine

Ignition solution not appearing

  • Ignition Version: 1.2.4
  • Laravel Version: 9.4.1
  • PHP Version: 8.1.2

Description:

I'm using the default configurations. I have also added a custom exception which implements Facade\IgnitionContracts\ProvidesSolution, but it doesn't appear on the error page.

FfprobeLengthException.php:

<?php

namespace App\Exceptions;

use Exception;
use Facade\IgnitionContracts\BaseSolution;
use Facade\IgnitionContracts\ProvidesSolution;
use Facade\IgnitionContracts\Solution;

class FfprobeLengthException extends Exception implements ProvidesSolution
{
    public function getSolution(): Solution
    {
        return BaseSolution::create('There was an error with the ffprobe command')
            ->setSolutionDescription("The video file may be invalid");
    }
}

RunCode.php

use App\Exceptions\FfprobeLengthException;

throw new FfprobeLengthException("Could not get video length");

Result:
image

Cannot run solution in this environment

This is just happening after the last update:

note: this is in the production environment.

{
    "class": "Spatie\\LaravelIgnition\\Exceptions\\CannotExecuteSolutionForNonLocalEnvironment",
    "message": "Cannot run solution in this environment",
    "code": 0,
    "file": "/var/www/vendor/spatie/laravel-ignition/src/Exceptions/CannotExecuteSolutionForNonLocalEnvironment.php:14",
    "trace": [
        "/var/www/vendor/spatie/laravel-ignition/src/Http/Controllers/ExecuteSolutionController.php:33",
        "/var/www/vendor/spatie/laravel-ignition/src/Http/Controllers/ExecuteSolutionController.php:20",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:48",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php:261",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php:204",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php:725",
        "/var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141",
        "/var/www/vendor/spatie/laravel-ignition/src/Http/Middleware/RunnableSolutionsEnabled.php:15",
        "/var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180",
        "/var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php:727",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php:702",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php:666",
        "/var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php:655",
        "/var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:167",
        "/var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141",
        "/var/www/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php:45",
        "/var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180",
        "/var/www/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http

composer.json:

{
  "name": "laravel/laravel",
  "type": "project",
  "description": "The Laravel Framework.",
  "keywords": [
	"framework",
	"laravel"
  ],
  "license": "MIT",
  "require": {
    "php": "^8.1",
    "ext-curl": "*",
    "ext-json": "*",
    "ext-openssl": "*",
    "ext-pdo": "*",
    "aws/aws-sdk-php-laravel": "~3.0",
    "darkaonline/l5-swagger": "^8.0",
    "doctrine/dbal": "^3.1",
    "fruitcake/laravel-cors": "^3.0",
    "gamegos/jws": "^1.0",
    "goetas-webservices/xsd-reader": "^0.3.6",
    "guzzlehttp/guzzle": "^7.0.1",
    "intervention/image": "^2.5",
    "laravel/framework": "^9.0",
    "laravel/octane": "^1.2",
    "laravel/telescope": "^4.7",
    "laravel/tinker": "^2.5",
    "league/flysystem-aws-s3-v3": "^3.0",
    "maatwebsite/excel": "^3.1",
    "monarobase/country-list": "^3.2",
    "namshi/jose": "^7.2",
    "owen-it/laravel-auditing": "^13.0",
    "php-open-source-saver/jwt-auth": "^1.1",
    "phpseclib/phpseclib": "^3.0",
    "predis/predis": "^1.1",
    "pusher/pusher-php-server": "^7.0",
    "s-ichikawa/laravel-sendgrid-driver": "^4.0",
    "scotteh/php-goose": "^1.1",
    "sentry/sentry-laravel": "^2.11",
    "spatie/laravel-ignition": "^1.0",
    "thedoctor0/laravel-mailjet-driver": "1.0.4",
    "twilio/sdk": "^6.34",
    "vlucas/phpdotenv": "^5.2",
    "voku/portable-utf8": "^6.0",
    "voku/simple_html_dom": "^4.7",
    "web-token/jwt-easy": "^2.2",
    "web-token/jwt-key-mgmt": "^2.2",
    "web-token/jwt-signature": "^2.2",
    "web-token/jwt-signature-algorithm-rsa": "^2.2",
    "zircote/swagger-php": "^3.0"
  },
  "require-dev": {
	"barryvdh/laravel-ide-helper": "^2.9",
	"fakerphp/faker": "^1.13",
	"kitloong/laravel-migrations-generator": "^5.0",
	"mockery/mockery": "^1.3.1",
	"nunomaduro/collision": "^6.1",
	"phpunit/phpunit": "^9.5"
  },
  "config": {
	"optimize-autoloader": true,
	"preferred-install": "dist",
	"sort-packages": true
  },
  "extra": {
	"laravel": {
	  "dont-discover": []
	}
  },
  "autoload": {
	"psr-4": {
	  "App\\": "app/",
	  "Database\\Factories\\": "database/factories/",
	  "Database\\Seeders\\": "database/seeds"
	},
	"classmap": [
	  "database/seeds"
	],
	"files": [
	  "app/helpers.php"
	]
  },
  "autoload-dev": {
	"psr-4": {
	  "Tests\\": "tests/"
	}
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "scripts": {
	"post-autoload-dump": [
	  "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
	  "@php artisan package:discover --ansi"
	],
	"post-root-package-install": [
	  "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
	],
	"post-create-project-cmd": [
	  "@php artisan key:generate --ansi"
	]
  }
}

PhpStorm isn't opened when managed by Toolbox

Duplicate of #343 on the other repository.

Standalone PhpStorm without Toolbox will have no issue with the phpstorm:// only when managed by Toolbox.
https://youtrack.jetbrains.com/issue/IDEA-283631

At this point maybe the user should be more involved in choosing the IDE, or there should be a dropdown in the UI about that where they can toggle between IDEs:

  • Auto
  • JetBrain PhpStorm
  • JetBrain Toolbox + PhpStrom

⚠ This also breaks when the .idea directory is not present.

Ignition default config outside of appdir

Hello there,

After installing ignition, I stumbled upon an open_basedir restriction which triggers because ignition uses the home directory in Linux to store the default config (I assume to share the configs of different projects?), can we add an option to overwrite this behavior via config or keep the config somewhere inside the app directory?

I assume most people aren't comfortable loosening their open_dir restrictions.

image

Runnable solutions don't get their execute_endpoint anymore

It looks like spatie/ignition is still trying to create an endpoint to execute the solution with a controller that doesn't exist anymore (it does exist in spatie/laravel-ignition though):

https://github.com/spatie/ignition/blob/main/src/Solutions/SolutionTransformer.php#L6

This causes a couple of properties to be missing from the solutions. This is what I get:

{
    class: 'Spatie\\LaravelIgnition\\Solutions\\GenerateAppKeySolution',
    title: 'Your app key is missing',
    description: '',
    links: { 'Laravel installation': 'https://laravel.com/docs/master/installation#configuration' },
    action_description: 'Generate your application encryption key using `php artisan key:generate`.',
    is_runnable: true,
}

I expect to also see run_button_text, run_parameters and execute_endpoint. When an error is created in ignition and doesn't pass through laravel-ignition, is_runnable should be false.

Class LogMessage not found

I keep getting the following error:

Class \"Spatie\\LaravelIgnition\\Recorders\\LogRecorder\\LogMessage\" not found

in the file spatie/laravel-ignition/src/Recorders/LogRecorder/LogRecorder.php

I suspect this is similar to: spatie/laravel-ray#237

I "solve" it by putting opcache_reset() in public/index.php

Error sometimes in Logs : Argument #2 ($reportBindings) must be of type bool, null given.

I'm getting this error sometimes in my LOGS :

[2022-05-21 04:00:04] local.ERROR: Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php on line 170 {"exception":"[object] (TypeError(code: 0): Spatie\\LaravelIgnition\\Recorders\\QueryRecorder\\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php on line 170 at /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/Recorders/QueryRecorder/QueryRecorder.php:19) [stacktrace] #0 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(170): Spatie\\LaravelIgnition\\Recorders\\QueryRecorder\\QueryRecorder->__construct() #1 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(871): Spatie\\LaravelIgnition\\IgnitionServiceProvider->Spatie\\LaravelIgnition\\{closure}() #2 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(756): Illuminate\\Container\\Container->build() #3 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(855): Illuminate\\Container\\Container->resolve() #4 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(692): Illuminate\\Foundation\\Application->resolve() #5 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(840): Illuminate\\Container\\Container->make() #6 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(248): Illuminate\\Foundation\\Application->make() #7 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(63): Spatie\\LaravelIgnition\\IgnitionServiceProvider->startRecorders() #8 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Spatie\\LaravelIgnition\\IgnitionServiceProvider->boot() #9 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #10 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #11 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod() #12 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call() #13 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(928): Illuminate\\Container\\Container->call() #14 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(909): Illuminate\\Foundation\\Application->bootProvider() #15 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}() #16 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(910): array_walk() #17 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() #18 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(239): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap() #19 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith() #20 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #21 /var/data/inpicture/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle() #22 {main} "}

Specs :

Laravel 9
PHP 8.1.5

Error Page is not rendering CSS.

Hello there! I just updated a Laravel 8 application to Laravel 9. In my composer.json I updated:
"facade/ignition": "^2.5" to "spatie/laravel-ignition": "^1.0"

I then ran composer update. In a sample route file: I manually threw an exception with throw new \Exception('testing').
The error page that get rendered shows the content but the CSS is not being loaded. I have included a image at the bottom.
Is there something I'm missing or an additional composer command I need to run?

Thank you for the assistance.

Screen Shot 2022-02-10 at 8 04 27 AM

SQL error should close only with collapse icon.

  • Version: 1.0.10
  • Laravel: 9.5

When a SQL error occurs, some times I want to copy only a part of SQL query or simply select some part to hightlight and focus on it, but every time that a click is made on SQL query, the layer collapse.

I think that is better to open the error with a click on any layer part, but to close is a better option to close only using the collapse icon.

Copy all SQL with the copy button and paste after in a editor is almost always slow than select some SQL chunks directly from ignition.

Thanks!

Ignition causes timeout after RelationNotFoundException

In a controller method I was trying to load a relationship. I accidentally used snake case instead of camel case for a 2-word relationship, and Laravel immediately threw a RelationNotFoundException. However, the browser kept on spinning for another 60 seconds before PHP killed execution due to timeout.

The timeout error doesn't happen in a consistent place, I saw a number of different code locations for it, none of which are in the Ignition codebase, but this only happens with Ignition enabled. If I uninstall Ignition, a "whoops" error is triggered immediately.

Using Laravel 8.79 and PHP 8.1. Tested with Ignition 0.0.9 and 1.0.1. Tried setting enable_runnable_solutions => false and solution_providers => [] without any change.

Code being run was a basic controller method:

    public function edit(Client $client): Response
    {
        $client->load("users", "user_profiles");
        return response()->view("clients.edit", compact("client"));
    }

Stack trace is as follows, please advise if there's any other detail I can provide.

[2022-01-19 23:48:25] local.ERROR: Call to undefined relationship [user_profiles] on model [App\Models\Client]. {"userId":1,"exception":"[object] (Illuminate\\Database\\Eloquent\\RelationNotFoundException(code: 0): Call to undefined relationship [user_profiles] on model [App\\Models\\Client]. at /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/RelationNotFoundException.php:35)
[stacktrace]
#0 /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(692): Illuminate\\Database\\Eloquent\\RelationNotFoundException::make(Object(App\\Models\\Client), 'user_profiles')
#1 /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(106): Illuminate\\Database\\Eloquent\\Builder->Illuminate\\Database\\Eloquent\\{closure}()
#2 /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(694): Illuminate\\Database\\Eloquent\\Relations\\Relation::noConstraints(Object(Closure))
#3 /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(662): Illuminate\\Database\\Eloquent\\Builder->getRelation('user_profiles')
#4 /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(642): Illuminate\\Database\\Eloquent\\Builder->eagerLoadRelation(Array, 'user_profiles', Object(Closure))
#5 /project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(597): Illuminate\\Database\\Eloquent\\Builder->eagerLoadRelations(Array)
#6 /project/app/Http/Controllers/ClientController.php(56): Illuminate\\Database\\Eloquent\\Model->load('users', 'user_profiles')
#7 /project/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ClientController->edit(Object(App\\Models\\Client))
#8 /project/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('edit', Array)
#9 /project/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\ClientController), 'edit')
#10 /project/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#11 /project/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\Routing\\Route->run()
#12 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#13 /project/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#14 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#15 /project/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#16 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'admin')
#17 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#18 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#19 /project/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#20 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#21 /project/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /project/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#23 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#24 /project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#25 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#26 /project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#27 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#28 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#29 /project/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#30 /project/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#31 /project/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#32 /project/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#33 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#34 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#35 /project/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#36 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#37 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#38 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#42 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#43 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#44 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#45 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#46 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#47 /project/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /project/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#53 /project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#54 /project/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#55 /project/server.php(21): require_once('/Users/mike/Sit...')
#56 {main}
"} 
[2022-01-19 23:49:25] local.ERROR: Maximum execution time of 60 seconds exceeded {"userId":1,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 60 seconds exceeded at /project/vendor/nesbot/carbon/src/Carbon/Traits/Date.php:908)
[stacktrace]
#0 {main}
"} 

Some exceptions return a default symfony exception

Versions

  • Laravel version 8.81.0
  • PHP version 8.0.14
  • spatie/laravel-ignition ^1.0

Description

When some errors occur with the 'spatie/laravel-ignition^1.0package the default symfony exception occurs, however thefacade/ignition` package this returns the Ignition error page for the same error. This was tested by downgrading and revisiting the same page.

I discovered when using the Resources in my application. When inside the toArray method I called an undefined function it threw the default symfony page, not the ignition page.

But when I call the same undefined function in say the web.php file it returns the ignition error page correctly.

Observation

I did dig through the code and also the stack trace as the code trace shows the exception hitting the ignition package and the renderer. Calls the ignition error page and such. Then ends up showing the old error page. (not sure if it has to do with the re-throwing of the exception as because of the Error issue?)

But it does appear the issue does maybe originate within the IgnitionWhoopsHandler::class ? The section that catches the Error class and throws a new ErrorException.

I found by remove all of that and using just the render code it works alright. Is this because of being for Laravel 9?

Reproduction

I created a reproduction repository to show the error.

https://github.com/ReeceM/ignition-error-repo

It has the following routes:

Key

✅ - Shows correct error page
❌ - shows symfony page

url result info
127.0.0.1:8000/with-default-resource doesn't use toArray
127.0.0.1:8000/without-inertia Just uses the function in routes file
127.0.0.1:8000/ this calls a UserResource and function is in toArray
127.0.0.1:8000/with-json anonymous JsonResource class with toArray defined
127.0.0.1:8000/with-model the model has a custom toArray method
127.0.0.1:8000/with-model-json this uses the torsion method to cast

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.