Laravel is an open-source PHP framework that follows the MVC pattern. It is a very popular PHP framework that reduces the cost of development and improves code quality. Our extensive collection of Laravel Interview Questions will help you find a great job. Laravel 5.8 is the latest & current version. It releases on 26th February 2019; Bug Fixes Until August 26th, 2019 and Security Fixes Until February 26th, 2020.
There are various features of laravel 5.8 are listed below:-
Laravel 5.8 supports new Eloquent hasOneThrough relationship type. We can use a hasOneThrough relationship to access a supplier's account history details through the account model
public function accountDetail()
{
return $this->hasOneThrough(AccountDetail::class, Account::class);
}
Laravel 5.8 introduces improvements in email validation logic by acquiring the package egulias/email-validator
utilized by SwiftMailer.
Token guard provides basic API authentication, and now it supports storing API tokens as SHA-256 hashes. Token Guard Token Hashing provides improved security over storing plain-text tokens.
It is an essential feature. It is a serverless NoSQL database invented by Amazon Web Services. The default setting for the dynamodb cache driver can be configured in the configuration file.
It is more convenient, new mock and spy methods have been added to the core Laravel test case class. It automatically binds the mocked class into its container.
$this->mock(Service::class, function ($mock) {
$mock->shouldReceive('process')->once();
});
Laravel 5.8 allows us to customize the timezone of a scheduled task using the timezone method:
$schedule->command('inspire')->hourly()->timezone('America/Chicago');
It allows a more granular expiration time when storing values and provides agreement with PSR-16 caching standard; the cache item value time-to-live has changed from minutes to seconds.
The put, add, but many, remember and setDefaultCacheTime methods of the Illuminate\Cache\Repository
class and its extended classes, as well as the put function of each cache store were modified with this changed behavior.
If we are passing an integer to any of these functions, we should update our code to validate you are passing the number of seconds you wish the value to remain in the cache. Alternatively, we may pass a DateTime instance highlighting when the item should expire:
// In Laravel 5.7
Cache::put('foo', 'bar', 20);
// Laravel 5.8
Cache::put('foo', 'bar', 20);
// Laravel 5.8
Cache::put('foo', 'bar', now()->addSeconds(20));
Laravel 5.8 allows us to pass the entire command, including options with the first string argument to the method:
Note : This information is asked in Laravel interview questions.
Artisan::call('migrate:install --database=foo');
In laravel 5.7 releases, Artisan's serve command would serve our application on port 8000. If another serve command process is already listening on this port, an attempt to serve a second application via serve will fail. But in Laravel 5.8, serve will now scan for available ports up to port 8009, allowing us to serve multiple applications at a single time.
Laravel provides support for the ~2.0 release of the Carbon date manipulation library.
Laravel provides support for the ~4.0 release of the Pheanstalk queue library. If we are using Pheanstalk library in our application, then please upgrade our library to the ~4.0 release via Composer.
We have a list of laravel interview Questions and Answers and Laravel 5 Interview Questions and Answers then you can click these links. These are really helpful to crack your future interviews.