We take a look at new features and changes in Laravel 5.8 you should be aware of whether starting a new project or upgrading an existing one.
We take a look at new features and changes in Laravel 5.8 you should be aware of whether starting a new project or upgrading an existing one.Introduction:
Laravel 5.0 was released in February 2015 and a 5.x update has been released roughly every six months since then. As 5.7 was released in September 2018, we can expect to see the initial release of Laravel 5.8 sometime around March 2019.
In this article we’ll take a quick look at some new features or important changes that you should be aware of whether creating a new project from scratch or updating an existing one.
As always, before upgrading a Laravel version, be sure to carefully read and understand the upgrade guides to ensure a smooth upgrade process.
So here’s a few important updates coming to Laravel 5.8.Email validation:
Laravel’s built in validation rule for email in 5.8 will now allow for international characters in email addresses.
If you have the following validation code:
$request->validate([ 'email' => 'email', ]);
And attempt to validate an email address such as
[email protected]är.se in 5.7, it will fail. However it will pass validation in 5.8.
In 5.7 the validation logic did not match with the logic used by SwiftMailer (the PHP mailer library used by Laravel), but now they both conform to RFC6530 compliance.dotenv 3.0:
Laravel 5.8 will support the relatively new dotenv 3.0 to manage your project’s .env environment file.
The key new features in dotenv 3.0 are support for multiline strings and white space at the end of strings in your environment file, for example, something like:
Will only return
specialstringfor, whereas in 5.8 the whole
specialstringfor thisapp will be parsed. It will also respect any spaces at the end of the string, which were previously stripped from the environment variables.
This is a great update for situations where multiline API keys are required for security.Mailables directory name change:
This is less of a new feature but an important element you will need to be aware of when upgrading a project.
If you have mailables in your project and you have customised the components using the
php artisan vendor:publish command, the folder names have changed slightly, namely the
/resources/views/vendor/mail/markdown directory is now named
/resources/views/vendor/mail/text. This is because both folders can contain markdown code for making good looking responsive html templates with plain text fallbacks. It’s more logical to call the markdown folder text
Laravel 5.8 will ship with new error pages featuring a very minimalist design that is intended to be more suitable for a range of websites and web apps without needing to be re-designed to fit a theme.
You can still customise the error pages or import your previous designs if you prefer them(see our tutorial on custom Laravel error pages).Array and String helper functions are deprecated:
str_* global helpers have been deprecated and will be removed in Laravel 5.9. There are
Str:: facades that should be used instead. There will be packages available to maintain functionality if you can’t or don’t want to re-work existing code but it is good practice to get used to the new commands now if you need to use them.
An existing array_ function such as:
function array_add($array, $key, $value)
Should be replaced with:
Arr::add($array, $key, $value)
Similarly string helper functions such as:
function str_contains($haystack, $needles)
Should be replaced with:
In fact, if you check the 5.8 code for array_* and str_* global helpers you’ll see they already simply use the facade version.Caching — ttl now in seconds instead of minutes:
If you are using Laravel’s caching functions take note that if you are passing an integer to the cache function in 5.8 it will apply the time to live in seconds and not minutes as it currently is in 5.7, so this command:
Cache::put('foo', 'bar', 30);
Will store the item for 30 minutes in Laravel 5.7 and 30 seconds in Laravel 5.8. A simple but important difference!JSON values in MySQL:
If you are storing JSON values in MySQL and MariaDB database columns, in 5.7 Laravel would return values wrapped in double quotes. 5.8 returns the same values in cleaner strings.
The following is the example from the Laravel upgrade guide which illustrates the change:
Carbon version 2 support:
$value = DB::table('users')->value('options->language'); dump($value); // Laravel 5.7… '"en"' // Laravel 5.8… 'en'
You will now have the option of using Carbon 1 or Carbon 2 for your DateTime functions in Laravel 5.8. Check the Carbon migration guide if you intend to use Carbon 2.Nexmo and Slack Notification channels:
The Nexmo and Slack Notification channels have been removed from the main Laravel project and extracted into first-party packages.
To continue using Slack or Nexmo functionality in your project you’ll need to use:
composer require laravel/nexmo-notification-channel composer require laravel/slack-notification-channel
They can then be configured and used as before.
So that pretty much covers the key changes you should be aware of. We always like checking out new software releases at Welcm Software, and look forward to the release of 5.8 soon.
PHP is widely used open-source scripting language it helps in making dynamically easy your websites and web application. Mobiweb Technology is your best technical partner and offering you solution for any kind of website and application...
PHP is widely used open-source scripting language it helps in making dynamically easy your websites and web application. Mobiweb Technology is your best technical partner and offering you solution for any kind of website and application development. To hire PHP developer and web developer at affordable prices contact Mobiweb Technology via [email protected]
CMARIX is leading Laravel Web application Development Service Provider with the track record of implementing diverse high-performance Laravel web applications with skilled Laravel developer team for clients across the globe<a href="https://www.cmarix.com/laravel-framework-development-services.html?utm_source=SB" target="_blank">.Continue</a>
CMARIX is leading Laravel Web application Development Service Provider with the track record of implementing diverse high-performance Laravel web applications with skilled Laravel developer team for clients across the globe.Continue
Many experienced players prefer to give it a go ahead with PHP for their web development needs because of the simplicity that PHP provides. PHP is loaded with features that many other languages lack and those pre-defined features can bring new functionalities and finishing touch to your existing or new website that you are looking forward to create. Wouldn’t it be great to get the best PHP Web Development Company for your project; we have a reputation as few of the leading firms in IT industry when it comes to PHP development.
Perks you should keep an eye out for before considering to outsource project to any web development company:
1. Company’s Reputation- It is very important to know about the previous projects that the company has delivered and the success rate of those products. You can visit company’s website for client testimonials or can google reviews given to them by genuine clients. We follow transparency, you can contact our previous clients and let them tell you how their experience was while working with us.
2. Technical Skill set and Expertise- You should select a company that has multiple resource pool of expert and technically sound developers. Our developers are experienced with different PHP frameworks and are exceptionally good with writing bug free codes. You can also hire PHP developer in India from us, as our developers have on hand experience in PHP development (core and frameworks)
3. The Budget- Costing has always played as one of the most important roles in every business deal. We provide competitive pricing with no hidden cost guaranteed. With us you can expect your project to be in best quality with no compromise to be made even with the best price in the market.
Why Data EximIT is the best PHP web development company in India?
Here are some of the features that might love about Data EximIT:
Reputation of Data EximIT is wonderful among the previous clients.
We have around 87% of retention ratio of clients.
We were time committed, means every milestone was achieved before or on time.
Data EximIT follows Agile development so it was the best possible methodology.
We have huge team with different expertise over multiple PHP frameworks, so you are provided with ample to options to choose from.
We are very active in communication part. Method or time of communication was never an issue at Data EximIT.
We have some of the best designers to ensure that your project not only functions but also looks and feels fabulous.
We provided customers with best costing without compromising on the quality at all.
We also provide dedicated PHP developer or team of PHP developers on hire for your project.
Data EximIT is where customers feel confident to come up with idea and leave with fully functioning & best in quality projects. You can also avail our developers at your requested site location if you decide to hire PHP developers in India from us.
Feel free to contact our experts and let success reach you by working with the best PHP web development company.