{"id":5823,"date":"2015-12-28T06:59:12","date_gmt":"2015-12-28T06:59:12","guid":{"rendered":"https:\/\/9series-blog.staging9.com\/?p=5823"},"modified":"2026-03-03T10:43:28","modified_gmt":"2026-03-03T10:43:28","slug":"laravel-development-5-2","status":"publish","type":"post","link":"https:\/\/www.9series.com\/blog\/laravel-development-5-2\/","title":{"rendered":"What\u2019s New to Laravel 5.2?"},"content":{"rendered":"<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/laravel_5.21.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1143\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/laravel_5.21.jpg\" alt=\"laravel_5.2\" width=\"800\" height=\"550\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\">PHP is known to have a less than desirable syntax, it is easy to deploy, easy to use and is actually powering countless modern websites which are used day-to-day. Laravel is a free open source framework available for developers which is based on PHP programming language. It provides beautiful shortcuts, tools, and components that assist in accomplishing all web based projects. Laravel aims to fix some of PHP\u2019s flaws as well.<\/p>\n<p style=\"padding-top: 20px\">The beauty of using Laravel is that it has a creative and semantic syntax that makes it outstanding among various frameworks available for the programming language. It is a perfect choice for amateur projects as well as enterprise solutions. There are continuous improvement &amp; enhancements in Laravel framework by the community developers. The recent announcement of Laravel 5.2 update contains few excellent new features. It continues the improvements made in Laravel 5.1 by adding multiple authentication driver support, simplified eloquent global scopes, implicit model binding, middleware groups, opt-in authentication scaffolding, array validation improvements, rate limiting middleware, and more.<\/p>\n<p style=\"padding-top: 20px\"><strong>Have a look on new features Laravel 5.2 are:<\/strong><\/p>\n<p style=\"padding-top: 20px\"><strong>Authentication Scaffolding<\/strong><\/p>\n<p style=\"padding-bottom: 20px\">Laravel already makes it simple to handle authentication on the back-end; however, Laravel 5.2 provides a handy, lightning-fast way to scaffold the authentication views for front-end. Simply execute the make:auth command on terminal:<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1127\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_3.png\" alt=\"php_code_3\" width=\"627\" height=\"24\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\">This command will generate plain, Bootstrap compatible views for user registration, login and password reset. The command will also update routes file with the relevant routes.<br \/>\n(<strong>Note : <\/strong>This feature is only meant to be used on new apps, not during application upgrades.)<\/p>\n<p style=\"padding-top: 20px\"><strong>Authentication Drivers \/ \u201cMulti-Auth\u201d<\/strong><\/p>\n<p>In former versions of Laravel, only the default, session-based authentication driver was supported out of the box, and a user could not have more than one authenticatable model instance per application.<\/p>\n<p style=\"padding-top: 20px\">However, in Laravel 5.2, a user can define additional authentication drivers as well define multiple authenticatable models or user tables, and manage their authentication process independently from each other. For eg, if an application has one database table for \u201cstudent\u201d users and another database table for &#8220;admin&#8221; users, a user may now use the Auth methods to authenticate against each of these tables individually.<\/p>\n<p style=\"padding-top: 20px\"><strong>Implicit model binding<\/strong><\/p>\n<p>Implicit model binding is the latest feature which automatically binds a model to a route. Below is an example in code:<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1128\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_7.png\" alt=\"php_code_7\" width=\"542\" height=\"86\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\">What this does is behind the scenes call <a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1129\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_2.png\" alt=\"php_code_2\" width=\"179\" height=\"17\" \/><\/a> and inserts it into the $post variable. In Laravel 5.1, it would need to practice the Route::model method to instruct Laravel to inject the AppUser instance which matches the {user} parameter in route definition. Therefore, in Laravel 5.2, the framework will automatically include this model based on the URI segment, allowing to quickly gain access to the model instances user require.<\/p>\n<p style=\"padding-top: 20px\"><strong>Array Validation<\/strong><\/p>\n<p>This is very excellent feature. For example: you have a form with an array of input fields like this:<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1130\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_5.png\" alt=\"php_code_5\" width=\"548\" height=\"183\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\">While in Laravel 5.1 to add validation rules, it required looping through and adding the rules separately. Instead of having to do all that it\u2019s been \u201cLaravelized\u201d into this:<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1131\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_6.png\" alt=\"php_code_6\" width=\"546\" height=\"105\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\"><strong>Middleware Groups<\/strong><\/p>\n<p>Middleware groups enable to group many route middleware below a single, convenient key, allowing to assign several middleware to a route at once. For eg, this can be useful when building a web UI and an API within the same application. The user may group the session and CSRF routes into a web group, and possibly the rate limiter in the api group.<\/p>\n<p style=\"padding-top: 20px\"><strong>Rate Limiting<\/strong><\/p>\n<p>A latest rate limiter middleware is presently included with the framework, facilitating to easily restrict the number of requests that a given IP address can make to a route over a particular number of minutes. For eg, to limit a route to 60 requests every minute from a single IP address, user may do the following:<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1132\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code_4.png\" alt=\"php_code_4\" width=\"547\" height=\"91\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\"><strong>Collections Wildcards<\/strong><\/p>\n<p>When utilizing a collection and wanting to pull out data, user can now pass a * as a wildcard:<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1133\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2015\/12\/php_code1.png\" alt=\"php_code1\" width=\"542\" height=\"44\" \/><\/a><\/p>\n<p style=\"padding-top: 20px\"><strong>Eloquent Global Scope<\/strong><\/p>\n<p>In earlier versions of Laravel, global Eloquent scopes were complex and error-prone to implement; though, in Laravel 5.2, global query scopes only require to implement a single, simple method: apply.<\/p>\n<p style=\"padding-top: 20px\"><strong>Database Session Driver<\/strong><\/p>\n<p>The database session driver now covers user_id and ip_address so user can easily clear all sessions for a given user.<\/p>\n<p style=\"padding-top: 20px\">Hence, Laravel helps the application to stay alive and relevant utilizing established software development patterns. Using Laravel framework is definitely beneficial to your business from technology point of view. 9series <a href=\"https:\/\/www.9series.com\/services\/laravel-web-development.html\">Laravel developers<\/a> have successfully developed software solutions employing Laravel framework. Our efforts are always focused towards exploring business problems, identify it and fix it using the latest &amp; right technologies such as Laravel. You can <a href=\"http:\/\/www.9series.com\/contact-us.html\">contact<\/a> us for your Laravel Development Requirement.<\/p>\n<p style=\"padding-top: 20px\">Image source- Laravel blog<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP is known to have a less than desirable syntax, it is easy to deploy, easy to use and is actually powering countless modern websites which are used day-to-day. Laravel&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5824,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"dsgo_overlay_header":false,"dsgo_overlay_header_text_color":"","dsgo_overlay_skip_top_bar":false,"_designsetgo_exclude_llms":false,"footnotes":""},"categories":[5],"tags":[1737,1738,1726,1739,1740],"class_list":["post-5823","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-laravel-5-2-update","tag-laravel-developers","tag-laravel-development","tag-laravel-technologies","tag-php-programming"],"_links":{"self":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/5823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/comments?post=5823"}],"version-history":[{"count":1,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/5823\/revisions"}],"predecessor-version":[{"id":5832,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/5823\/revisions\/5832"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/media\/5824"}],"wp:attachment":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/media?parent=5823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/categories?post=5823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/tags?post=5823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}