for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Rinvex\Categories\Providers;
use Rinvex\Categories\Models\Category;
use Illuminate\Support\ServiceProvider;
use Rinvex\Support\Traits\ConsoleTools;
use Rinvex\Categories\Console\Commands\MigrateCommand;
use Rinvex\Categories\Console\Commands\PublishCommand;
use Rinvex\Categories\Console\Commands\RollbackCommand;
class CategoriesServiceProvider extends ServiceProvider
{
use ConsoleTools;
/**
* The commands to be registered.
*
* @var array
*/
protected $commands = [
MigrateCommand::class => 'command.rinvex.categories.migrate',
PublishCommand::class => 'command.rinvex.categories.publish',
RollbackCommand::class => 'command.rinvex.categories.rollback',
];
* {@inheritdoc}
public function register()
// Merge config
$this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.categories');
// Bind eloquent models to IoC container
$this->app->singleton('rinvex.categories.category', $categoryModel = $this->app['config']['rinvex.categories.models.category']);
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
$categoryModel === Category::class || $this->app->alias('rinvex.categories.category', Category::class);
// Register console commands
! $this->app->runningInConsole() || $this->registerCommands();
}
public function boot()
// Publish Resources
! $this->app->runningInConsole() || $this->publishesConfig('rinvex/laravel-categories');
! $this->app->runningInConsole() || $this->publishesMigrations('rinvex/laravel-categories');
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.