Laravel Community Tools by Tighten

Tag "5.0" tricks

75 tricks
I was looking for a way to change the .env-values within a controller or from something else. I found nothing, so I created my own little method. It takes an array of new values. The array key must be the key from the .env. The script overwrites the old .env. Yet not perfect, but works for now. UPDATE: I am developing a package which will provide this functionality in a better way. The package will ship with some more features. UPDATE: Here is the Link to the Package: https://github.com/Brotzka/laravel-dotenv-editor. Give it a try ;) There will be more features in a few days.
Brotzka 9 years ago 32243
5.0
This is a short video series in two parts about how you can setup different user roles for users in your application using Laravel. It conists of users, roles and user_role tables for this type of relationships between users and their roles. It should all be clearly explained inside of the tutorials. There are ways of improving this functionality and it is really easy to add more roles if needed, build on top of it etc. Hope it will be useful to you and if you have any questions, ask away :) https://www.youtube.com/watch?v=KMR2H6-K36E
Novica89 9 years ago 8130
Learn how to make a function to easily test which menu items should be marked as active depending on which page you are currently viewing in your browser. Add class of active to bootstrap menu items on different pages. Wherever you need to apply an active class ( or any other class ) in order to make a menu item active depending on which page you are currently viewing, or for any other sort of functionality you might need, this is the way you can do it with Laravel ( or plain PHP just a bit differently ) Watch the video on how to do it https://www.youtube.com/watch?v=E1oit3sd-7k
Novica89 10 years ago 8833
The primary reason why SSL is used is to keep sensitive information sent across the Internet encrypted so that only the intended recipient can understand it. As a web developer one should always provide the SSL for their clients so that they can share their critical information, freely trusting the encryption. This is important because the information you send on the internet is passed from computer to computer to get to the destination server.
jamilaliah... 10 years ago 9239
5.0
With this trick we add custom queries in the laravel paginator.
Hoosk 10 years ago 6966
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 15963
Learn how to power your Laravel application so that you are using ajax alongside Laravel pagination to fetch new content ( posts or whatever entity you need to display ), without refreshing the page. Video tutorial -> https://www.youtube.com/watch?v=3cmbkEQG8is
Novica89 10 years ago 10095
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 16075
simple paginate using table from database and displaying in blade
PunnaRao 10 years ago 7798
5.0