Laravel Community Tools by Tighten

Tag "troubleshooting" tricks

35 tricks
Bumped into a problem while trying to authorize user against laravel basic auth middleware when testing a REST API through phpunit. I used phpunit call method to send a POST request to API's endpoint which needed users basic HTTP authentication. Every time, laravels basic auth middleware rejected it and I had no idea why, since I've sent proper HTTP Authorization header with phpunit call. Here is the solution ! Or watch it in a video https://www.youtube.com/watch?v=LCrt7jqDsgU Read more on http://laravel.io/forum/03-20-2014-authbasic-fails
Novica89 10 years ago 15957
When you have a model with unique value column and tries seeder your table using a big amout, sometimes the QueryException is thrown, because Faker doesn't know what values was previously generated and the number of combinations is limited.
lcdss 10 years ago 16070
In Laravel 5, by default you have CSRF in every single POST. If you are new to Laravel and you use the usual HTML code to create inputs and forms then you will definitely encounter that error. Also, if you are coming from Laravel 4, again you might not know how to solve this error since 'Illuminate\Html\HtmlServiceProvider' is not installed by default anymore and HTML inputs and form have to be used. There are 3 solutions in order to fix it. 1) If you want to keep the usual HTML code and not use 'Illuminate\Html\HtmlServiceProvider' (since it is not installed by default in Laravel 5), then you can delete this line of code '\App\Http\Middleware\VerifyCsrfToken::class,' in app/Http/Kernel.php. However this is not a good practice. You can still do that though, in case you are building something small or an API. 2) You can install 'Illuminate\Html\HtmlServiceProvider' and do it the old good Laravel 4 way, which uses tokens by default, thus you don't have to worry about it anymore. 3) The last solution is in case you want to code the front end with the usual HTML code then you can use this line in your layout or in case you don't have a layout then in every single page. <input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" /> You can get Laravel 5 tutorials and projects for all levels (Beginners-Intermediate-Advanced) in this website www.codeexecutable.com/courses
codeexecut... 10 years ago 9788
I'm having a porblem trying to solve this error.. anyone encountered this beforre?
dnates2014 10 years ago 7157
replace this in the start/global.php file:
Mahmoudz 10 years ago 7650
Variable Dump Helper, a function to dump variables to the screen, in a nicely formatted manner. This is useful if you want to see the contents of your variable array. This is originally created by Mr. Joost van Veen. Source: https://gist.github.com/accent-interactive/3838495
kankuro 10 years ago 8124
Simply add the following lines to ./app/start/global.php at the "Application Error Handler" - Section there is no need to touch the "CSRF Protection Filter" at all.
etenzy 11 years ago 20950
Until Taylor makes it part of Homestead, here's one way to add SSL support for your dev sites. Plenty of room for improvement, so please add your ideas. For example, generating the ssl certs in the loop, instead of including them.
jhauraw 11 years ago 24049
Sometimes, you have differences between your dev set-up and production set-up that requires you to be able to set a different value for public_path. In your bindings.php file, just add the following code and you will be good.
ve2gmr 11 years ago 10598