Temporarily hide the Whoops page in Laravel 5.4? - laravel-5

When my PHP script goes wrong, I see a nice Whoops page with all details of the error.
However, sometimes I need to see the output of where it went wrong (for example in a loop with 1 million items, but only 1 of them gives a problem, I need to see which item). I flush the output after each item, so the page behind the Whoops page shows the last item at the bottom of the page.
Is there a way to hide the Whoops page (temporarily) ?
Using Chrome DevTools, I now hide the DIV that has the class 'Whoops_container' , but it would be nice if there's a more elegant way.

EDIT explanation: I'm sorry some stackoverflow mods have deleted my post, since they thought I just answered with a link. It's a short time solution and if the link expired the solution expires and it needs to be solved a different way (if the PR gets included the answer is obsolete and the question is also obsolete, if the PR is not accepted I will create a fork and the link needs to be updated anyway).
But since I know how annoying this Whoops behavior can be I added the answer again:
I created a pull request for adding a "hide-button". You can see the necessary changes here: https://github.com/filp/whoops/pull/579/files
This might help until they integrate it, or if they decide not to integrate it.
Here are the changes extracted from the pull request, to add some value to the link:
src/Whoops/Resources/views/header.html.php (add this below the other Button ("COPY")
<button id="hide-error" class="rightButton" title="Hide error message" onclick="document.getElementsByClassName('Whoops')[0].style.display = 'none';">
HIDE
</button>
src/Whoops/Resources/views/header.html.php (add this on the end)
.rightButton {
cursor: pointer;
border: 0;
opacity: .8;
background: none;
color: rgba(255, 255, 255, 0.1);
box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
border-radius: 3px;
outline: none !important;
}
.rightButton:hover {
box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
color: rgba(255, 255, 255, 0.3);
}

If error is common you can ingore that globally. For an example ValidationException or ModelNotFoundException then you can ignore that exception.
In Handler.php in Laravel there is an array it's called $dontReport. You can register your exception class here and ingore your exception Globally.
protected $dontReport = [
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Validation\ValidationException::class,
];
You also can write custom output code into render function to handle your exception.
Good Luck!

Related

Is there a way to fix custom fonts that are blurry after adding ng-bootstrap?

I'm creating an Angular 7 CLI application that uses ng-bootstrap. Before adding ng-bootstrap, I had custom fonts applied to buttons that were working and showing up nicely. Since adding ng-bootstrap, the fonts are blurry.
I've already tried adding SCSS to the main styles.scss file:
button {
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
}
I've also tried:
button {
-webkit-font-smoothing: inherit;
}
In addition, I did add the !important class to try and force it. When I remove the custom font from the button, the default font appears crisp and clear.

SCSS variables alignment in PhpStorm

How to easily format fragments of code like the one below in PhpStorm?
before:
$some-var-1: 0;
$some-longer-name: 1px solid true;
$some-variable: 3px;
.className {
border: $some-longer-name;
padding : $some-variable;
}
after:
$some-var-1 : 0;
$some-longer-name: 1px solid true;
$some-variable : 3px;
.className {
border: $some-longer-name;
padding: $some-variable;
}
As you can see variable assignments are formatted in one way and the rest of the code in another way.
By default I can set auto formatting so it formats like it's .className but how can I make PhpStorm so the variables format in the way shown in the second example? It would be best if I could format all cases in one file at once.
Currently it's not possible.
https://youtrack.jetbrains.com/issue/WEB-9211 -- watch this ticket (star/vote/comment) to get notified on any progress.

Magento Homepage blank space under main slider

I cant find any related solution to my problem here on stack over flow but here we go. i have checked footer space and marked related module with zero spacing for slide but still it is not working.
Please see www.sateeni.com and under main homepage slider i have some unwanted space and don't know why its there. Please need help to find out why and where the problem is. sorry if its very basic thing but i am new to magento so cant figure out the reason. I have tried all options but no luck.
Thanks in advance.
Adam
Your main content container is showing and even though it is empty, the CSS has padding and a minimum height:
.main {
padding: 20px 0;
min-height: 370px;
}
You can either use CSS to overwrite this min-height on the homepage only
.container.full-width {
padding: 0;
min-height: 0;
}
or just hide this element on the homepage only.
.container.full-width {
display: none;
}

How to get rid of `border-bottom` style in GNOME panel's button

I want to make new gnome-shell theme which now the theming is lack of documentation yet.
Please look on the image below,
I want to get rid of the border-bottom (likely). And I tried in several ways and just change other element, not the one I mean.
Here, I try to manipulate element with .panel-button class,
.panel-button {
border: 1px solid #ff0;
}
.panel-button:active,
.panel-button:checked,
.panel-button:focus,
.panel-button:hover,
.panel-button:overview {
border: 1px solid #ff0;
}
But nope, it produce unexpected result.
It's a strange way, but I myself found by looking inside gnome-shell-viva-theme source.
We can use gradient with the same color,
.panel-button:active,
.panel-button:checked,
.panel-button:focus,
.panel-button:hover,
.panel-button:overview {
background-gradient-direction: vertical;
background-gradient-start: $bg-color;
background-gradient-end: $bg-color;
}
It is not a perfect answer, still looking the better one.
The property must to be changed is a box-shadow property.
#panel .panel-button:active,
#panel .panel-button:overview,
#panel .panel-button:focus,
#panel .panel-button:checked {
box-shadow: none;
}

CSS2 Validation error with Gradient

The following is my CSS code:
table th{ font-family:arial; font-size:9pt; color:#ffffff; background: -moz-linear-gradient(#b9cdde, #7c98ae); border: 1px solid #ffffff; }
table th:last-child{ background: -moz-linear-gradient(#729cc3, #35699a); }
I get a validation error with CSS which says
Value Error : background Too many values or values are not recognized : -moz-linear-gradient(#b9cdde,#7c98ae) -moz-linear-gradient(#b9cdde,#7c98ae)
Does someone have any idea as to why this might be happening?
Vendor-specific selectors such as -moz-linear-gradient are not part of the official CSS2 specification, so when the validator finds then, it will throw an error. Personally, I don't mind if stuff like this doesn't validate - it's only a nice, cleanly written gradient.

Resources