Some Cool features of Laravel 8

Some Cool features of Laravel 8

Laravel is a most popular framework of PHP and it has a great Community support. We can easily find forums as well as Laravel communities if we need some answers with Something. Laravel 8 comes with exciting new features. This post contains a summary of some of the new capabilities announced. Let’s take a look at some of those great new features!

# Maintenance Mode

some new attributes has been added to maintenance mode like if I want to instruct the browser to refresh the page in specified seconds.

php artisan down — refresh=15

If I want to access the web using www.example.com/1630542a-246b-4b66-afa1-dd72a4c43515 while the website still down.

php artisan down — secret="1630642a-246b-4b66-afa1-dd72a4c43516"

Now I can tell Laravel to redirect all requests to the specified routes when maintenance.

php artisan down — redirect=/

# Rate Limiter

In Laravel 8, we limit the HTTP request in the RouteServiceProvider where it’s very flexible to use.

RateLimiter::for('uploads', function (Request $request) {
return Limit::perMinute(1000);
   
});


# Laravel Octane

Octane is the latest Official Laravel package where it makes your application run on top of the Swoole server. Running the Laravel using Octane will make the app performance up to 10x faster than traditional artisan serve. Also, in Octane, we can run the PHP codes asynchronously/concurrently so it can handle a lot of heavy tasks in no time.

[$users, $servers] = Octane::concurrently([
    
fn () => User::all(),
fn () => Server::all(),

   
]);


Octane also has a feature to use the Swoole Table, where it can perform extreme read/write for your app. Also, we can use cache using Swoole as the driver.

# Job Batching

Job Batching features are useful when we want to execute some jobs at the same time (but not concurrently) and we can catch the callback whether the job is successfully executed or not.

# Laravel Jetstream

Jetstream is a package where it provides us the scaffolding/boilerplate for our starting point in the project. It has abundant features such as user profile management, authentication, email verification, 2FA, team management features, etc.

# Squashing Migration

When the project gets bigger and bigger, we may notice that we have a lot of migration files. In Laravel 8, we can squash all of the migration files into one single SQL schema.

php artisan schema:dump --prune

With that command, we’ll have a schema file and whenever we run the artisan migrate, Laravel will execute the schema file first then check the remaining migration files.

# Route Caching

Laravel uses route caching to compile your routes in a PHP array that is more efficient to deal with. In Laravel 8, it’s possible to use this feature even if you have closures as actions to your routes. This should extend the usage of route caching for improved performance.


References


要查看或添加评论,请登录

Tousif Khan的更多文章

  • Why we should use Memcache

    Why we should use Memcache

    An application having many products and options with large number of traffic, you may need to cache the most-used data…

    2 条评论
  • It's time to utilize Redis for your Applications.

    It's time to utilize Redis for your Applications.

    Redis is a "NoSQL" key-value data store. More precisely, it is a data structure server.

  • Basic coding standards

    Basic coding standards

    Code conventions are important to programmers for a number of reasons: ? 40%–80% of the lifetime cost of a piece of…

    2 条评论
  • Steps to minimize website load time

    Steps to minimize website load time

    Think slow response time of your website doesn’t matter? Think again. 1 second delay in page load time yields: 11%…

    2 条评论
  • Building your Web Applications backoffice with "GROCERY CRUD"

    Building your Web Applications backoffice with "GROCERY CRUD"

    As a PHP web developer you will often have the problem to create a simple, stable and secure backoffice system. How…

  • Why would I choose Spark over Hadoop?

    Why would I choose Spark over Hadoop?

    Spark and Hadoop are big data processing projects of Apache. Sometimes they are making confusion for user in choosing…

    1 条评论
  • 22 QUICK STEPS FOR MYSQL OPTIMIZATION

    22 QUICK STEPS FOR MYSQL OPTIMIZATION

    MySQL and MariaDB are popular choices for database management systems, now a days database sizes reaches to GB, TB or…

    2 条评论

社区洞察

其他会员也浏览了