welcome this is Victor from coders tape and today we are doing a level 5.8 preview stick around so we're going to be doing a laravel five-point-eight
preview now everything that I will be showing you today has already been merged into the five point eight branch however laravel five point eight has not been officially released yet it should
be another couple of weeks and we should see five point eight get tagged so we have some big changes to talk about we have some small changes to talk about and some stuff that's gonna get
deprecated for 5.9 however with things like deprecations it's never too soon to start planning ahead so up first we're gonna be talking about the new email validation so in level five point seven
you may have noticed that sometimes email validation doesn't quite accept some emails but that has been fixed in laravel five point eight so this is a totally fresh five-pointed installation
that I have here on my system so let me jump into my web browser to show you this first change so we have our typical route here I'm gonna add a new route just for testing purposes and will say
get we'll call it email validation that's passing the closure just for demonstration purposes I'm gonna call my request and then I'm gonna call validate on it and I'm going to be looking for a
field of email and this needs to be an email address so where is it gonna look for email well in this case it's gonna look for anywhere in the request so what we can actually do is email validation
and then let's add it as a query string email equals say user at and then let's say something like espana right and that is gonna have a special character in it calm let's check out what happens so
clearly we are passing this is not throwing an exception at all and this is something that would have thrown an exception in the elbow five point seven okay so with this setup I do want to
tell you I did the exact same thing to a five point seven installation so I want to show you the difference between both of them so if we move back here's our five eight in five point seven you
got an error like this the given data was invalid and that's because emails were actually getting validated in a different way than the package the letter Vil actually uses for sending
email so now that matches so in five point eight user at espana comm is a valid email up next this is probably one of the biggest changes coming to laravel five eight and that is the new release
of dot EMV 3.0 dot E and V is the package that laravel uses for your EMV files so here's my EMV file for five point seven so to show you the difference we're gonna do a side-by-side
again I'm gonna add a new entry here and I'm gonna call it coders test let's go ahead and just say string then in my route web file I'm gonna add a new route here get and let's go ahead and call
this EMV for passing a closure and we will simply return env coders test let me change the address here from email to EMV and there we are we're getting string back now if you added this to a
new line and then maybe set string again let's check out the results nothing and that's because dot EMV version two which is what layer of l57 was running does not support multi-line that's coming now
for level five eight let me copy this over to level five eight and show you the difference okay so we have the same string down here and let me just go ahead and copy the route okay soft copy
the exact same route and I've copied the same exact EMV settings here let's head over to Chrome and now visit EMV and there it is multi-line support the reason behind it
is that it will allow you to have bigger and longer keys as it currently stands EMV files can only really hold a small string once you get into multi-line keys and stuff like that
you have to use something else so from here now in level five point eight you will be able to do multi-line entries now going without the next feature I want to show you is that it doesn't
remove any additional spaces I'm going to add a bunch of spaces here after this string so let me refresh this and now it's not easy to see here because obviously hTML is not gonna have
repeated however if we take a look at this file here you see that we have those spaces there so it is not trimming strengths that's another new feature of DA DMV files it
will respect exactly what you pass in in contrast hit refresh and nope that string is completely trimmed there's nothing afterwards so that's another difference between five seven
and five eight so up next is a directory change and that is in the May levels class so if we run PHP artisan make mail and we said markdown emails dot test tests available so we have available
created let's go ahead and publish the markdown emails PHP artisan vendor published and what we are looking for is right here laravel mail that's the tag that we're looking to publish so we'll
say 10 and now let's check out back in phpstorm resources views and here it is vendor this is the directory change right here this is you say HTML and used to say markdown now it's text and that's
for plain text because they can actually both contain markdown so it was a little confusing before so the directory has been renamed to text so in contrast in level 5.7 I have the same directory
opened here and you see that we have HTML and mark down again 45.8 that directory has been renamed text all right up next we're gonna be taking a look at the new error pages so let's add
a new route route and we'll call this error let's pass in a function and simply abort let's start with a 403 type over here let me fix that there we go I think
you'll agree these new pages look very nice they're very modern and I do think that a lot of folks are gonna like these let's check out five point seven error
page and we'll do the exact same thing here I'll say get error function and again we're just gonna abort with a 403 all right let's check out the difference here and there it is so this is the 5.7
version and this is the 5.8 again I think you'd agree this is great I love this design but it doesn't fit for every situation this is a much cleaner modern look let's look at a
500-page for example it's changes to a 500 and there you go server error what about a 404 and there you go 404 not found I think these new pages are very clean very modern but remember
as always you can override these air pages and make your own or even revert back to the 5.7 pages if you wanted to by just importing them from your old project so rest assured you can brand
these pages the same as you did before all right up next we're gonna talk about a small change only affecting JSON columns in MySQL so for that let me jump to the documentation and let's find the
laravel upgrade guide so here's the upgrade guide and if you scroll down just a tad here it is unquote at my sqa json values so the query builder used to return something like this where you
would have almost double quoted strings but now in 5.8 you're gonna get some clean strings so that's a nice addition and I think a lot of developers are gonna like that so now let's move on to
another important step and that is deprecations in level 5.8 a lot of the array helper functions have actually been marked as deprecated now this is not a breaking change just yet but it is
announced that they're gonna be removed in five point nine in the next coming months definitely start using the new notation for array let me show you where you can find that that's under
illuminate support and then it's the helpers that PHP file so as you can see array add has been marked as deprecated so this is the new notation you would use the ARR facade and then just call
add on it now let me find another one of these let's see so we have array collapse as bin array divided array dot except first flattened you get the point a lot of them have been marked for
deputation so go ahead and stop using them so array only is one of them I actually use that one all the time so this is the new notation so why are these being marked as deprecated well
for one they're actually not doing anything anymore what they actually do is just simply delegate to the facade version of this so there's no actual functionality being plucked away but
really is just call the parent function and - we are defining all of these functions and I'm talking about hundreds of them in the root namespace for functions and what
can happen is that some packages may be defining functions in this namespace and they're conflicting and when they are everything blows up so by using the facade versions you can rest assure that
all of your laravel functionality is going to work perfect no matter what packages you pulled in again these are being marked as deprecated they have not been erased but it is right here they
will be removed in level five point nine so in the next coming months go ahead and refactor all of your code that is using these and move it over to the facade version so that's it for a level
five point eight preview today if you have any questions at all hit us up on twitter at coders tape and don't forget to subscribe for brand new weekly content on laravel marketing and web
development for coders tape this is Victor thanks for watching
-
carbonimmutable
dotenv
laravel
laravel 5
laravel 5.7
laravel 5.7 new features
laravel 5.7 what's new
laravel 5.8
laravel 5.8 deprecations
laravel 5.8 install
laravel 5.8 new feature
laravel 5.8 tutorial
laravel 5.8 what's new
laravel best packages
laravel best practices
laravel best tutorial
laravel cache
laravel dynamodb
laravel mysql json
laravel new features
laravel news
laravel preview
laravel tutorial
mysql json
php carbon immutable
php framework
php framework 2019
php what's new 2019