Laravel 5.7.17 is accessible with new query builder methods, a new message for detecting lost connections in MariaDB, and improvements to adding foreign keys in Postgres. First, we have a new method in the query builder for the INSERT INTO SELECT statement, without loading data into memory. The insertUsing() method allows you to copy all (or some) columns from one database table to another using the following syntax: $builder-> from ( ' table1
Laravel 5.7.16 is available with new translation messages for the 403 and 503 blade templates and enabling the migrator to accept not only migration directory paths but also file paths too. First up, the 403.blade.php file now has a translatable exception message and fallback: @section ( ' message ' , __ ( $exception -> getMessage( ) ? : __( 'Sorry, you are forbidden
Laravel 5.7.13 was released on 7th Nov 2018 with some new collection methods and the ability to return an array of messages in a custom validation rule. First, new empty collection methods were added, including whenEmpty, whenNotEmpty, unlessEmpty, and unlessNotEmpty. For example, the whenEmpty method will fire this callback on an empty collection: use Illuminate\Support\Collection ; $collection =
To give back to our community of developers, we looked at our database of thousands of projects and found the top 10 errors in JavaScript. We’re going to show you what causes them and how to prevent them from happening. If you avoid these "gotchas," it'll make you a better developer. Because data is king, we collected, analyzed, and ranked the top 10 JavaScript errors. Rollbar collects all the errors for each project and summarizes how many times each one occurred. We
The Laravel team released Laravel 5.7.10 on 23 October 2018 with a handful of new features, fixes, and changes: loadCount Eloquent Collection Method First up, is the ability to load relationship counts on an Eloquent collection. Before this feature, you could only load relationships, but now you can call loadCount() to get counts for all relations. The pull request illustrates how you could use loadCount() with the following example: &n
In this quick tutorial, you'll learn how to process large files in PHP, avoiding methods that won't work because of memory limitations. If you want to process large files using PHP, you may use some of the ordinary PHP functions like file_get_contents() or file() which have a limitation when working with very large files. Memory Limitation These functions rely on the memory_limit setting in the php.ini file; you may increase the value but these function
There are plenty of articles out there highlighting the importance of creating content for users, not search engines. This advice isn’t wrong, but it only tells half the story. Here’s why: If your content doesn’t match any search terms that real people use, you won’t get any traffic from search engines. And while publishing a keyword stuffed article isn’t a good idea, not taking the user’s search behavior into consideration isn’t a