Skip to main content

Top 10 Laravel Packages to Install in 2020 – Part 2

Page 1

Top 10 Laravel Packages to Install in 2020 – Part 2

www.bacancytechnology.com


Laravel is one of the simplest and the easiest form of framework to be used when developing the backend of an application. In Top 10 Laravel Packages to Install in 2020 – Part 1, you might have come across what Laravel packages are and how you can introduce each of them within your web application. The article clearly outlines the top Laravel packages that help developers in the development process.

Without much ado, let’s move ahead to see what are these?


1. Spatie The sole purpose of creating a Spatie package is to allow you to embed roles and permissions within your application. Setting up different roles and admin permission on various activities within your website or the application is essential, considering the security and viability of the same. While you can do it manually, the Spatie Laravel Package gives you the ease to push roles right from the database.

Installing the package

composer require spatie/laravel-permission Push Migration

php artisan vendor:publish -provider="Spatie\Permission\PermissionServic eProvider" --tag="migrations"


Migrate to Database

PHP artisan migrate Publishing Configuration Files

php artisan vendor:publish -provider="Spatie\Permission\PermissionServic eProvider" --tag="config" Source


2. Laravel User Verification Setting up a website and registering users, you would need to have an email validation form embedded. The Laravel User Verification Package is one that does exactly the same. It is designed in a way that can store as well as handle validation token every time a user clicks for verification.

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 Email Subject'); return $this->registered($request, $user) ?: redirect($this->redirectPath()); } Source


3. Migration Generator Having multiple database tables isn’t something new. Instead, every website has two or more tables to store different forms of data. The Migration Generator Laravel Package is one that allows you to initiate migrations from one table to another. These include foreign keys, indexes, and further allows you to make a pick of tables involved in the migration.

php artisan migrate:generate table1,table2


4. Laravel Backup Create a robust backup of all your data files with this exclusive package, Laravel Back-up. Keeping in mind the need to have the data stored and backed up, developers have designed the Laravel Backup package that creates a zip file of the application along with the data stored within it. The package gives the flexibility to store them at any of the systems. To execute the function, run the command:

PHP artisan backup: run


5. No Captcha The No Captcha Laravel Package is designed, keeping in mind the need to avoid spamming activities. What the package does is implement the protection and validation of Google reCaptcha. The sole purpose here is to prevent all sorts of spamming and render the website error-free. To initiate the package, you are first required to get access to the API key. This is available free from reCaptcha, and once obtained, you can then run the following. Add the following in app/config/app.php :

⌿ The ServiceProvider to the provider’s array : Anhskohbo\NoCaptcha\NoCaptchaServiceProvi der::class,


⦿ The class alias to the aliases array : 'NoCaptcha' => Anhskohbo\NoCaptcha\Facades\NoCaptcha::cl ass, ⦿ Publish the config file php artisan vendor:publish -provider="Anhskohbo\NoCaptcha\NoCaptchaS erviceProvider" Source


6. Laravel GraphQL If you have been accustomed to the concept of using traditional REST architecture, you will love the way Laravel’s GraphQL package behaves. Designed as the data query language, GraphQL makes it easier for developers to define their server structure and embed GraphQL within their apps. Installing The GraphQL Package

composer require rebing/graphql-laravel In case you are using Laravel 5.5 or above, the package would be detected automatically. However, for versions below 5.5, you need to add the following:

Rebing\GraphQL\GraphQLServiceProvider::class


And,

GraphQL' => 'Rebing\GraphQL\Support\Facades\GraphQL', Publish and View The Configuration File:

$ php artisan vendor:publish -provider="Rebing\GraphQL\GraphQLServicePro vider" config/graphql.php


Create Schemas For Designing The Endpoints of GraphQL

'schema' => 'default_schema', 'schemas' => [ 'default' => [ 'query' => [ 'example_query' => ExampleQuery::class, ], 'mutation' => [ 'example_mutation' => ExampleMutation::class, ], ], 'user' => [ 'query' => [ 'profile' => App\GraphQL\Queries\ProfileQuery::class ], 'mutation' => [ ], 'middleware' => ['auth'], ], ], Full Code


7. Tinker Tinker is an exceptionally useful package of Laravel that helps developers test and try certain features without actually writing a script. In other words, the package allows debugging in real-time. Suppose that you want to check a few records in the database or perform specific operations. The Tinker Laravel Package would enable you to test and debug on your browser screen in a matter of clicks. The Tinker Laravel Package has Laravel framework embedded within and hence, eliminates the need to manually install the same when using it with your application.


Full Code


8. Intervention/Image Intervention/Image is one Laravel Package that allows developers to create, edit, and appealingly modify images. The package is open-source, and developers can use it as per their requirement. In order to install the said package, run the following:

composer require intervention/image Source


9. Beautymail

Full Code


10. Laravel Slack With Laravel, you can quickly push all your notifications to the standard slack Channel. However, with the onset of the Laravel Slack package, you now have the ease to simplify things the way you want them to be. The package allows you to send messages directly from the platform to different channels.

class HelloMessage extends SlackMessage { public $content = "Hey bob, I'm a sending a custom SlackMessage"; public $channel = '@bob'; } \Slack::send(new SlackMessage()); If needed, a dummy can be created to test the feature and functionality of the package. Source


Epilogue With this, we come to an end to the list of top packages for the Laravel application. It is seen that Laravel packages are extremely helpful in cutting down the time of development while enhancing the end to end productivity. So, if you are planning to optimize your applications or build a new one, the packages, as mentioned above, would be a great help to take into consideration. If you are looking for the experts who can do the needful, then hire Laravel developers from us as we are a globally renowned Laravel development company and have helped all the shapes and sizes of businesses to succeed in today’s digital world.


Thank You


Turn static files into dynamic content formats.

Create a flipbook
Top 10 Laravel Packages to Install in 2020 – Part 2 by Bacancy Technology - Issuu