Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

Top Laravel Packages Which You Can Use to Optimize App in 2020

March 19, 2019

9 Min Read
laravel packages
Reading Time: 9 minutes

What is a Package?

As a PHP developer, you must be familiar with how to use frameworks. Frameworks attempt to make the process of development easier by simplifying common practices used in developing major web projects such as packages, modules, plug-ins, and even components.

Laravel Packages

Laravel is one of the most popular frameworks for developing web applications. It offers simple and fast development environment for developers. Laravel aims to take the tedium out of routine web projects like authentication, routing, sessions, and caching, making the development process simple and straightforward. It won’t sacrifice application functionality and facilitates the developers to carry out custom defined operations. For instance, you can use different ways for accessing relational databases, can perform dependency injection and much more through these packages.

Build, Deploy & Manage Web Apps on Your Fingertips

Forget about the hosting hassles, deploy & manage your web apps with complete freedom

There are two types of packages; some are framework independent (stand-alone) and the others are for a specific framework. This tutorial will exclusively cover best Laravel packages available in the dev market.

One great advantage of using Laravel packages is that they allow access to all the features that framework offers to its host application, including routing, migrations, tests, views, and numerous other useful features. Another important advantage of a package is the Don’t Repeat Yourself (DRY) principle.

In this blog, I will  demonstrate important best Laravel packages that you must know and regularly use in Laravel applications.

Laravel Package Development Process

For Laravel package development, when writing packages, your package will not typically have access to all of Laravel’s testing helpers. If you want to be able to write your package tests as if they existed within a typical Laravel application, you may use the Orchestral Testbench package.

  1. Setup your Composer.json file for New Package
  2. Add Service Provider
  3. Set Alias
  4. Create Facade class

These are four important steps that you must know for writing a Laravel package for your speedy development process.

Powerful Laravel Hosting For All Your Needs

Grow your Laravel app with our feature-rich managed hosting

Best Laravel Packages

There are many packages for Laravel that make application faster and speedy, taking care of security and performance factors themselves. I will demonstrate top Laravel packages below which you can use to optimize your application performance.

1. Spatie

Roles and permissions form an important part of many web applications. Laravel historically had a lot of packages for them, and improved the core code as well. Spatie Roles & Permission is one of there best permissions package.

Advantages

  1. Roles
  2. Permissions
  3. Direct Permissions
  4. Middleware
  5. Multiple Blade Directives
  6. Artisan commands

2. Entrust

This package provides a flexible way to add Role-based Permissions to your Laravel 5 application. This package creates four tables: roles table for storing role records, permissions table for storing permission records, role_user table for storing one-to-many relations between roles and users, permission_role table for storing many-to-many relations between roles and permissions.

You can create role by writing the following code,

$admin = new Role();

$admin->name = 'admin';

$admin->display_name = 'User Administrator'; // optional

$admin->description  = 'User is allowed to manage and edit other users'; // optional

$admin->save();

Let’s check how to assign the roles to the users,

user = User::where('username', '=', 'michele')->first();

$user->attachRole($admin);

Now, you must give permissions to these roles:

$createPost = new Permission();

$createPost->name         = 'create-post';

$createPost->display_name = 'Create Posts';

$createPost->description  = 'create new blog posts';

$createPost->save();

$admin->attachPermission($createPost);

3. Laravel Debugbar

Laravel Debugbar is one of those best Laravel packages that helps users add a developer toolbar to their application(s). This package is mainly used for debugging purposes. There are lot of options available in Debugbar. It will help you to show all the queries that your application offers – everything related to the route – that you have called will show all the rendered templates, as well as all the parameters that you have passed. You can add messages using the Façade (when added), and it will show under ‘Messages’ tab in Laravel Debugbar.

Debugbar::info($object);

Debugbar::error('Error!');

Debugbar::warning('Watch out…');

Debugbar::addMessage('Another message', 'mylabel')

4. Laravel User Verification

This package allows you to handle user verification and validates email(s). It generates and stores a verification token for the registered user, sends or queue an email with the verification token link, handles the token verification, sets the user as verified. This package also provides a functionality, i.e verified route middleware.

public function register(Request $request)

{

   $this->validator($request->all())->validate();

   $user = $this->create($request->all());

   event(new Registered($user));

   $this->guard()->login($user);

   UserVerification::generate($user);

   UserVerification::send($user, 'My Custom E-mail Subject');

   return $this->registered($request, $user)

       ?: redirect($this->redirectPath());

}

5. Socialite

Socialite offers a simple and easy way to handle OAuth authentication. It allows the users to login via some of the most popular social networks and services including Facebook, Twitter, Google, GitHub and BitBucket.

$user = Socialite::driver('github')->user();

// OAuth Two Providers

$token = $user->token;

$refreshToken = $user->refreshToken; // not always provided

$expiresIn = $user->expiresIn;

// All Providers

$user->getId();

$user->getName();

$user->getEmail();

$user->getAvatar();

6.Laravel Mix

Formerly known as Laravel Elixir, Laravel Mix provides a clean and rich Application Programming Interface (API) for defining webpack-build steps for your project. It is the most powerful asset compilation tool available for Laravel today.

mix.js('resources/assets/js/app.js', 'public/js')

.sass('resources/assets/sass/app.scss', 'public/css');

7. Eloquent-Sluggable

Slugging is the process of creating a simplified, URL-friendly version of a string by converting it to one case and removing spaces, accented letters, ampersands, etc. With Eloquent-Sluggable, you can easily create slugs for all the Eloquent models in your project.

class Post extends Eloquent

{

   use Sluggable;

   protected $fillable = ['title'];

   public function sluggable() {

       return [

           'slug' => [

               'source' => ['title']

           ]

       ];

   }

}

$post = new Post([

   'title' => 'My Awesome Blog Post',

]);

// $post->slug is "my-awesome-blog-post

8. Migration Generator

Migration generator is a Laravel package that you can use to generate migrations from an existing database, including indexes and foreign keys. When you run the following command, you can create migrations for all the tables in your database.

php artisan migrate:generate

You can also choose only certain tables that you want to migrate:

php artisan migrate:generate table1,table2

9.Laravel Backup

This Laravel package creates a backup of all your files within an application. It creates a zip file that contains all files in the directories you specify along with a dump of your database. You can store backup on any file system. To create a backup, all you need to do is to run the following command:

php artisan backup:run

10.No Captcha

No Captcha is a package for implementing Google reCaptcha validation and protecting forms from spamming. First, you need to obtain a free API key from reCaptcha.

NoCaptcha::shouldReceive('verifyResponse')

   ->once()

   ->andReturn(true);

$response = $this->json('POST', '/register', [

   'g-recaptcha-response' => '1',

   'name' => 'Pardeep',

   'email' => 'pardeep@example.com',

   'password' => '123456',

   'password_confirmation' => '123456',

]);

11.Laravel GraphQL

GraphQL is a data query language that provides an alternative to traditional REST architecture. Developers define the structure of the data required, and get exactly the same structure from the server. This package will help you set up and use GraphQL in your Laravel apps.

Laravel Admin Panel Generator

There are two big groups of admin panel generators: visual builders and console-based. The choice depends on your preferences, whether you like to use GUI or type Artisan commands with parameters.

Also, an important term to remember here is a CRUD—this abbreviation stands for “Create, Read, Update, Delete”—these core operations are the building blocks of all admin panels.

12. Voyager: The Missing Laravel Admin

Voyager stands out with a polished and professional interface, but the main point is that it just works. Clear usage instructions, user friendly front-end theme, no obvious bugs or unfinished parts—that’s Voyager for you. Even the icons like captain’s picture makes it look nice overall.

Voyager offers interesting features, such as, dummy-data, media manager, etc.

13.LaraAdmin: Admin Panel + CRM

After installing and logging into your admin panel, this package allows you to visually create modules, which represent your CRUDs.

14. Orchid

RAD platform works fittingly well for building a business application using the Laravel framework. It can act as the core base for web applications, or can perform the functions of CMS, CMF or admin panel for your website.

Laravel Ecommerce Packages

15 Bagisto

Bagisto is an open source Laravel eCommerce package that has managed to catch the eyes of Laravel community, in a very short span of time. It offers out-of-the-box Laravel user management, multi-warehouse inventory management options and much more.

Also, the Laravel CMS package is bundled with built-in user-friendly admin panel navigation, offers functionalities like Multi-Currency, Localization, Access Control Level, Multi-Channel, Payment integration and much more.

16 AvoRed

You can easily customize the Open Source Laravel Shopping Cart as per your needs. It offers mobile-friendly interface layout by default, that is why also called one of the best Laravel SEO package.

The platform allows you to create product entities like category, attributes etc. with efficient order management capabilities to keep track of your order, customer information and inventory management, etc.

17. Laravel Telescope

Laravel Telescope is an elegant PHP debugger for the Laravel framework. It provides vivid insights into the requests coming onto your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps and much more. Telescope makes a wonderful companion to your local Laravel development environment.

Laravel SEO Packages

Laravel Meta Manager

By using Laravel Meta Manager, you can optimize your website’s SEO, thereby helping your website rank higher on the first page of the search engine. It emphasizes on the application’s Meta tags, helps you to correct them according to the best practices of SEO. The package comes with recommended Meta tags including Standard SEO, Dublin Core, Google Plus, Facebook Open Graph and many others.

SEOTools

SEOTools gives you the ease to optimize your Laravel SEO according to the latest techniques of the search engine rankings. Both Laravel 5+ and Lumen frameworks support SEOTools. It offers great website optimization features. The package is very easy to integrate within the projects, as it has a user-friendly interface that helps even beginners to quickly get started with it. It provides specific techniques to set titles and Meta tags both for the Twitter and Open Graph.

AutoMeta

AutoMeta is an excellent SEO optimization tool for Laravel that helps developers with some common SEO techniques. It is one of the top SEO tools for Laravel that provides easy management of website’s meta tags. The package also helps to fix some common SEO bugs in the application and make code simple to crawl for search engine bots.

Laravel Seoable

Laravel Seoable is one of the most used SEO packages for Laravel projects. It offers adequate SEO techniques that fine-tune the Laravel apps for search engine rankings. The package defines some core Laravel functions according to the best practices of SEO, such as mapping Eloquent attributes to SEO Meta tags, setting custom templates for page title/description, defining custom SEO data for applications models and many others.

Laravel-seo

Laravel-seo is another handy SEO package that allows you to insert, manage and delete website Meta tags with ease. By using this package, you can also insert structured data into the Laravel projects and can manage some of the most used SEO Meta tags like Facebook Open Graph, Dublin core and others effortlessly.

Final Words

This brings us to the end of this blog, I have demonstrated  different Laravel packages in this article which you can use to optimize your project’s productivity. As Laravel provides seamless ease to the developers to execute custom defined operations, opting one of these packages, users can easily perform their functional tasks with packages. It depends upon the needs and requirements of the project, to use those packages that help you perform your functional jobs.

If you want to share your thoughts about this article or want to recommend some more Laravel packages, feel free to share your opinions and suggestions in comments section below.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Launch Laravel apps with 1-Click Install. Painless Server Management

Deploy your apps on optimized Laravel hosting servers.

Pardeep Kumar

Pardeep is a PHP Community Manager at Cloudways - A Managed PHP Hosting Platform. He love to work on Open source platform , Frameworks and working on new ideas. You can email him at pardeep.kumar@cloudways.com

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

BFCM 2019