Laravel Community Tools by Tighten

Category "Routing" tricks

91 tricks
Will validate a route pattern against the current route.
eugene_san... 12 years ago 9748
Perform pattern based CSRF filter on all post, put, patch, and delete requests. Just add this code snippet at the top of routes.php
Illusion 12 years ago 6578
For example, if you are using a caching server which listens on HTTPS, which retrieves your content from another (local server) which isn't using HTTPS, your links might be generated as http://mysite.com instead of the desired https://mysite.com. With this trick you can circumvent this.
berendiwem... 12 years ago 9046
Uses "thepixeldeveloper/sitemap": "dev-master" in composer.json to create a better organised sitemap structure via multiple "files" (routes).
nik-418 12 years ago 10831
In the official docs : http://laravel.com/docs/responses#special-responses, need to do `Response::json(...)` to create json response. Actually, if the returned value is an array or instance of arrayableinterface or jsonableinterface such as eloquent model, you could just return it, it'll be a json, magically.
egig 12 years ago 71982
A Controller-based solution to add the CSRF filter to all POST requests.
danalloway 12 years ago 8926
Laravel 4 CSRF on all POST requests
localdisk 12 years ago 10112
Do not trust the client. Safe way to get CSRF token for use in Angular JS. Keeps it as a constant.
xtrasmal 12 years ago 42029
There are a few tips already for active states on navigation, however none are based on Route names. I prefer to use Route names for all routes, so here is a modified version of the "active states" trick for route names.
chadwithuh... 12 years ago 12912