Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Security Release - Laravel v5.6.30 and v5.5.42 have been released
Aug 09, 2018 @ 09:34:59

On the Laravel News site they've posted an announcement recommending all Laravel 5.6.x and 5.5.x users upgrade to the latest release (5.6.30 & 5.5.42) due to a security issue dealing with the APP_KEY value.

Laravel 5.6.30 and Laravel 5.5.42 have both been released to fix a security issue and is recommended that all users upgrade as soon as possible.

This update also includes changes to cookie encryption and serialization logic. In addition to the upgrade, they also recommend rotating the key if you believe any malicious user (or former developer/employee) had access to it. The upgrade guide has the information you need to make the update to your application.

tagged: laravel security release appkey cookie update framework

Link: https://laravel-news.com/laravel-5-6-30

Laravel News:
Laravel 5.7 Resources Directory Changes
Aug 08, 2018 @ 10:16:56

On the Laravel News site there's a new post sharing some of the changes to the "resources" directory that are coming in Laravel v5.7.

Taylor Otwell announced that in Laravel 5.7 the resources directory will be flattened instead of having an assets folder.

The post includes "before" and "after" examples of the directory structure change and shares some Laravel Mix configuration changes that can be used to move the assets pre-release of v5.7.

tagged: laravel resource directory change flatten announcement v57

Link: https://laravel-news.com/laravel-5-7-resources-directory-changes

Ben Sampson:
Speed up relationship queries in Laravel
Aug 07, 2018 @ 11:51:40

Ben Sampson has a tutorial posted to his site for the Laravel users out there sharing some tips about speeding up your database queries when using relationships between models.

Adding indexes to your database tables is a great way to get some extra performance out of your application, especially if you have a large amount of data in your tables. They should be used sparingly and only on identified slow queries, as they have implications of their own such as increased table size and increased RAM usage. But those potential drawbacks are well worth it when you can get a query down from a 3 seconds 15 milliseconds with 5 minutes of work. The effects are particularly noticeable on polymorphic / many to many polymorphic relationships.

He then includes the code required to create the indexes on your tables (either a single column or a compound index involving more than one column) in your migrations. He also provides code examples showing how to use foreign keys to improve one-to-one/one-to-many relationships. More examples include optimizations for many-to-many relationships and polymorphic relationships.

tagged: tutorial laravel index foreignkey relationship model migration optimize

Link: https://sampo.co.uk/blog/speed-up-relationship-queries-in-laravel

Laravel News:
Customizing the Laravel View Path
Aug 07, 2018 @ 09:42:41

On the Laravel News site they've posted a quick tutorial showing you how to change the path to views in a Laravel-based application.

In response to our post yesterday about Laravel 5.7 Resources Directory Changes, a reader mentioned that they would prefer to have their application views outside of the resources folder.

I thought I’d write up how you can customize the view path; it’s effortless with Laravel!

The change is made in the views.php configuration file, updating the value for the paths setting. You can point it to a single location (like the application path or resource path) or you can set multiple to tell the framework to search for the view in either. The post ends with a mention one thing to keep in mind about generating views and their location (and moving them around).

tagged: laravel tutorial customize view path resource application

Link: https://laravel-news.com/laravel-view-path

CodeWall:
Filtering Faulty HTML Using Purifier Package
Aug 06, 2018 @ 09:22:26

On the CodeWall site there's a tutorial posted showing you how to clean up HTML with the Purifier package, a Composer-installable service provider for Laravel that acts as an interface for the main HTMLPurifier package.

And as every programmer is an artist and makes his/her own copy of CMS to put in the content and publish on a click of a button. Every one of those websites will have a text editor on them, so we can see the result as we write our content.

You can always learn how to integrate a text/html editor on your Laravel installation on one of my posts. We set our own stylesheets for styling various attributes on our content. But for that to work correctly, we need to have a proper HTML code in place.

The tutorial then shows how to install and use the package in your Laravel application. It also includes some advanced steps to publish the configuration file and update its settings (including changes to the allowed HTML tags and allowed CSS properties).

tagged: tutorial laravel htmlpurifier package install configure

Link: https://www.codewall.co.uk/filtering-faulty-html-using-purifier-package/

Laravel News:
Laracon Chicago Recap
Aug 02, 2018 @ 13:19:50

For those that weren't able to make it to the Laracon US 2018 (Chicago) conference, the Laravel News site has posted a recap of the event and their experiences.

Laracon US 2018 is now in the books and it was a fantastic event and a lot of fun was had in Chicago. As someone who has never visited Chicago before I was very impressed with the city. The weather was magnificent and the parts I walked around seemed safe and pretty clean for a large city.

[...] Every Laracon strives to bring a great experience from the venue to the location, the swag, and this year didn’t disappoint.

The post then goes on to talk about some of the swag the conference handed out, the venue where it was held and a link to the keynote from Laravel creator Taylor Otwell (and a matching live blog). The post also includes several pictures the author (Eric Barnes) took during the conference.

tagged: laravel laraconus18 chicago recap conference

Link: https://laravel-news.com/laracon-2018-recap

Jason McCreary:
Laravel by the Numbers
Jul 30, 2018 @ 11:15:01

Jason McCreary, creator of the Laravel Shift service that makes it easier to upgrade your Laravel code to new versions, has a new post to his site where he shares Laravel "by the numbers", some statistics based on the use of the service.

I had the privilege to speak at Laracon again this year. The last Laracon talk I gave, Practicing YAGNI, is one I am most proud of. Initially, I wanted to do a continuation on this topic. But there were some other talks on related topics. So I thought, “what can I talk about that’s unique to me”.

The answer was Laravel Shift. As the creator of Shift I have a unique insight into Laravel apps.

I’m super sensitive about sounding salesy. I don’t want to talk about Shift itself. I want to talk about the data derived from Shift.

The statistics are based on around 8500 Laravel applications currently using the service. He shares the results for:

  • Most popular Laravel version
  • Most popular packages
  • Most changed file(s)
  • Custom namespacing

Along with these basic numbers, he also shares information about project structures, inheritance injection, facade "abuse", queries in views (using models) and many others. Check out the full post for details on these and other results.

tagged: laravel numbers statistics laravelshift results

Link: https://jason.pureconcepts.net/2018/07/laravel-numbers/

Matt Stauffer:
Introducing Laravel Nova: A Tool for Building Admin Panels and Custom CMSes
Jul 27, 2018 @ 10:16:01

Matt Stauffer has a new post to his site that takes a "deep dive" into Laravel Nova, the recently announced administration panel that's developed by the Laravel project. This is the first post in a new series.

These are my notes that I took during the announcement on 2018-07-25. I hope to go back later and update this after a more careful re-watching of the YouTube recording that's now up, so I could get some of my code samples more exact and catch anything I missed.

If you notice anything I missed or got wrong, please let me know on Twitter! And please check back in a few days so I have time to fix this up. :)

The post reads more like a live stream than a formal write up, but the good stuff is all there:

  • the basics of what Nova provides
  • how it works
  • defining a resource
  • working with fields
  • actions/filters
  • lenses
  • searching
  • auditing

...and much more. The post goes through each item, providing screenshots, context and code to show off the feature. If you want to see the announcement for yourself, check out the video over on YouTube.

tagged: laravel nova administration dashboard indepth features code

Link: https://mattstauffer.com/blog/introducing-laravel-nova-a-tool-for-building-admin-panels-and-custom-cmses/

Laravel News:
Introducing Laravel Nova
Jul 26, 2018 @ 09:41:57

On the Laravel News site they've posted an announcement about the release of Laravel Nova, an administration dashboard created and maintained by Taylor Otwell and the Laravel project maintainers.

We’re thrilled to announce Laravel Nova, a “beautifully designed administration panel for Laravel” created by the Laravel team.

The level of customization available in Nova is mind-blowing, and it’s quite intelligent out-of-the-box once you configure Nova resources for your application.

The frontend is powered by Vue.js with the backend hooking into your current Laravel application (with a bit of extra functionality added). Information and functionality provided by Nova includes resource management tools, searching via SQL queries, custom action definition and metrics. You can find out more information about its features on the project site and sign up for the mailing list for more information when it launches in August 2018. Nova will cost $99 USD for a solo license and $!99 USD for a "site" license (business).

tagged: laravel nova administration dashboard product announcement

Link: https://laravel-news.com/laravel-nova

Pineco.de:
Extending Laravel’s Collection With Macros
Jul 20, 2018 @ 14:43:29

On the Pineco.de blog they've posted a new tutorial showing how to extend the Collection functionality of Laravel with the help of macros.

Collections are fantastic features of the framework. With the functionality that the collection offers, we can easily handle any need that a dataset requires. But still, in some cases, we may extend with custom functionality.

The post starts with a more general look at what collection macros are and a few code snippets of them in action. To illustrate how to extend them, they create a "some" macro that takes in an anonymous function containing some kind of logic to check the key/value passed to it and return a boolean. The post finishes up by linking to the macro documentation and another package that implements a wide range of additional macros (like "extract", "paginate", "tail" and "transpose").

tagged: laravel collection macro tutorial some extend

Link: https://pineco.de/extendig-laravels-collection-with-macros/