Don't target PHP 5.2 or 5.3 for new projects
CodeIgniter 3.0 will support PHP 5.2. Anthony Ferrara wrote an interesting article on his blog why that's a very bad thing.
http://blog.ircmaxell.com/2014/12/on-php-version-requirements.html
Posts tagged with php
CodeIgniter 3.0 will support PHP 5.2. Anthony Ferrara wrote an interesting article on his blog why that's a very bad thing.
http://blog.ircmaxell.com/2014/12/on-php-version-requirements.html
Sitemap is a package built specifically for Laravel 4/5 that will help you generate XML sitemaps for Google. Based on laravel-sitemap this package operates in a slightly different way to better fit the needs of our project. A facade is used to access the sitemap class and we have added the ability to produce sitemap indexes as well as sitemaps. Furthermore, it's tested.https://github.com/dwightwatson/sitemap
Using this on polkadots.be.
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Freek publishes a super resourceful and practical newsletter. A must for anyone in the Laravel space"
Earlier today Spatie, the company where I work, launched a webshop polkadots.be. When the project started one of the first choices that we had to make was if we were going to use an existing solution or build our own custom solution. For this project we took an extensive look at some existing…
Evan Miller makes the case for offering xls-exports instead of csv-exports.
Most people of your website’s users are also Excel users. When they export their data as CSV, they’ll probably just bring it into Excel first to have a look around. You should probably offer an explicit XLS export, and take it seriously.http://www.evanmiller.org/please-offer-an-excel-export-option.html
An xls-file is capable of things that 'll never be possible in csv:
This is how you export all values from a given repository that returns Eloquent models:
Excel::create($pathToFile, function($excel) {
$excel->sheet('The sheet name', function($sheet) {
$sheet->freezeFirstRow();
$sheet->cells('A1:Z1', function($cells) {
$cells->setFontWeight('bold');
$cells->setBorder('node', 'none', 'solid', 'none');
});
$sheet->fromModel($this->yourOwnRepository->getAll());
});
})->export('xls');
The result is an excel-file with the header row frozen and underlined and it's values in bold.
Almost a year ago Igor Wiedler wrote three articles on his blog about the state of functional programming in PHP.
The first article explores iteration. You'll learn to turn this
$admins = [];
foreach ($users as $user) {
if (is_admin($user)) {
$admins[] = $user;
}
}
into this
use function iter\filter;
$admins = filter('project\user\is_admin', $users);
In the second one he explains a very nice way to traverse an associative array. How you currently do it:
$baz = (isset($data['foo']['bar']['baz'])) ? $data['foo']['bar']['baz'] : null;
How you'll do it in the future:
use function igorw\get_in;
$baz = get_in($data, ['foo', 'bar', 'baz']);
The final article shows you a nice syntax to handle objects that return null-values.
All the articles mention libraries that you can use in your code today.
If you've been following the news, you'll have noticed that yesterday Composer got a bit of a speed boost. And by "bit of a speed boost", we're talking between 50% and 90% reduction in runtime depending on the complexity of the dependencies. But how did the fix work? And should you make the same sort of change to your projects? For those of you who want the TL/DR answer: the answer is no you shouldn't.http://blog.ircmaxell.com/2014/12/what-about-garbage.html
Authy makes it easy to integrate two-factor authentication into your existing Laravel application. It's user-end implementation is versitile, offering support for both smart-phones and standard phones. Furthermore, implmentation with its API is easy and seamless. Finally, its analytics and data tracking can you provide insights into your users and how they interact with your application's authentication system.http://blog.enge.me/post/installing-two-factor-authentication-with-authyThis tutorial assumes that you have an Authy developer account (which can be created here ), an application (either testing or production), and your application's API key.
Spoiler: it's all about performance. Coming to a host near you in 2015.
http://www.infoworld.com/article/2841561/php/php-7-moves-full-speed-ahead.html
An excellent read for if you're dealing with a large legacy code base that mainly consists of spaghetti.
A PHP package for mapping remote API resources (usually RESTful) as models in an ActiveResource style.
Inversion of Control, or IoC, is a technique that allows control to be inverted when compared to classical procedural code. The most prominent form of IoC is, of course, Dependency Injection, or DI. Laravel's IoC container is one of the most used Laravel features, yet is probably the least understood.http://code.tutsplus.com/tutorials/digging-in-to-laravels-ioc-container--cms-22167
The question gets answered by Bill Karwin, the project lead of the 1.0 release.
http://www.quora.com/Why-is-the-Zend-Framework-not-popular/answers/8173410