PHPNews

Streaming large CSV files with Laravel chunked queries

Written by Stories by Barry vd. Heuvel on Medium - Published on Stories by Barry vd. Heuvel on Medium
Aggregated on Saturday September 19, 2015 - Permalink

How do you handle exporting a large dataset to the user? This post explains Symfony’s StreamedResponse and Laravel’s chunked queries. Exporting data When I create websites to manage data, like users, items, products etc., a common request is to have an export of the data. If this is a one-time request for plain data, you could just export it using your favorite admin-tool. But usually you …

Continue reading »


Using StackPHP middleware in Laravel 5

Written by Stories by Barry vd. Heuvel on Medium - Published on Stories by Barry vd. Heuvel on Medium
Aggregated on Saturday September 19, 2015 - Permalink

Laravel 4 was compatible with StackPHP middleware, but Laravel 5 uses a new way to handle middleware. This blog explains the differences and shows a way to still use Stack middleware. TLDR ; Want StackPHP middleware in Laravel 5.0? Try barryvdh/laravel-stack-middleware Middleware and Laravel 4 In version 4.1, Laravel introduced compatibility with StackPHP middleware . As Laravel …

Continue reading »


CSRF Protection in Laravel explained

Written by Stories by Barry vd. Heuvel on Medium - Published on Stories by Barry vd. Heuvel on Medium
Aggregated on Saturday September 19, 2015 - Permalink

In this blog we take a closer look into CSRF protection in Laravel. We compare the difference between the CSRF filter in Laravel 4 and the current VerifyCsrfToken middleware in Laravel 5. Why do we need CSRF protection? Laravel has CSRF-protection enabled by default. So even if you don’t know what CSRF is, or why we need to protect our apps from it, you probably run in to it pretty fast and …

Continue reading »


Unobtrusive JavaScript with jquery-ujs and Laravel

Written by Stories by Barry vd. Heuvel on Medium - Published on Stories by Barry vd. Heuvel on Medium
Aggregated on Saturday September 19, 2015 - Permalink

jquery-ujs is a script, originally created for Ruby on Rails, to simplify common JavaScript actions and make it easier to execute RESTful actions through links. Even though it was created for Rails, it works perfectly with Laravel. It is described like this on the readme: This unobtrusive scripting support file is developed for the Ruby on Rails framework, but is not strictly tied to any …

Continue reading »


OAuth in Javascript Apps with Angular and Lumen, using Satellizer and Laravel Socialite

Written by Stories by Barry vd. Heuvel on Medium - Published on Stories by Barry vd. Heuvel on Medium
Aggregated on Saturday September 19, 2015 - Permalink

In the last few weeks, Socialite was a popular topic to blog/tweet about. Coincidentally, I also needed Socialite for a project. But in my case, I wanted to use it in an Angular app, distributed using Cordova (Phonegap) as hybrid app on Android/iOS. There were some examples, but I couldn’t find much about it at the time. A few people asked to share my experience about it, so here it is! Before …

Continue reading »


Comparing Blade and Twig templates in Laravel

Written by Stories by Barry vd. Heuvel on Medium - Published on Stories by Barry vd. Heuvel on Medium
Aggregated on Saturday September 19, 2015 - Permalink

In my company, we use Twig instead of Blade for our Laravel projects. I know there are a lot of developers that also prefer Twig over Blade. So the question ‘Why choose Twig over Blade?’ often pops up. The reason is usually just a matter of preference, but in this post we’re going to compare the Blade and Twig templating engines side-by-side. TLDR; Spoiler alert Both Blade and Twig provide …

Continue reading »