I want to add service provider in laravel 11, but i am not sure how to add it using laravel 11. As previous version of laravel, it is added in config/app.php file, but in laravel 11 it needs to be added in packageServiceProvider file within providers folder. Below is my code, please tell me if i am wrong somewhere..
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class PaytmWalletServiceProvider extends ServiceProvider
{
/**
* All of the container bindings that should be registered.
*
* @var array
*/
public $bindings = [
ServerProvider::class => Anand\LaravelPaytmWallet\PaytmWalletServiceProvider::class,
];
/**
* Register services.
*/
public function register(): void
{
//
}
/**
* Bootstrap services.
*/
public function boot(): void
{
//
}
}
boostrap/providers.phpinstead of config/app.php though the old style should still work