Laravel Community Tools by Tighten

Category "Packages" tricks

44 tricks
In some cases Netshell/Paypal throws error "Class Paypal does not exist". In my case on ubuntu/php7/nginx (on windows with apache is ok). So here is simple workaround
escapeboy 9 years ago 7483
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 9761
The easy way to define Eloquent Global Scopes with https://github.com/jarektkaczyk/laravel-global-scope
jarektkacz... 10 years ago 8076
If you want to use Sentry 2 filters used in Laravel 4.x, you have to modify your system a little bit. <br/> First install Sentry 2 for Laravel 5: "composer require cartalyst/sentry:dev-feature/laravel-5" Next add these three files to your App\Http\Middleware folder, then add the references into the Kernel.php file. Finally, I added an example route how to use the Middlewares. An advice: in your controller replace all catch() lines from: catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {} to: catch (\Cartalyst\Sentry\Users\LoginRequiredException $e) {} because it won't work as in Laravel 4.x worked..
subdesign 10 years ago 15078
5.0
Laravel Cashier makes it easy to create subscription-based websites and collect money from customers. Passing an extra array to create() method allows passing data specific to Stripe's API along with creating a new subscription for the customer. To see which fields are supported check this section of Stripe's API: https://stripe.com/docs/api#create_customer
msurguy 11 years ago 10274
We have released the source code of this website! You can check out the repository containing a mirror copy of this website: https://github.com/CodepadME/laravel-tricks to create your own websites like Laravel-tricks. It uses PSR-2 coding standards, a ton of libraries and packages and is a good resource to take a look into.
msurguy 12 years ago 9631
I have added a sitemap to this very site and was thinking that some of you want to do the same for SEO purposes. The way to add a sitemap would be pretty easy by using a Blade template for the XML that sitemap requires but there is an easier solution. You can use a package from https://github.com/RoumenDamianoff/laravel4-sitemap that would make it super simple to generate a sitemap for your Laravel application. See for yourself.
msurguy 12 years ago 35173