The
app
function returns the service container instance:<?php $container = app();
<?php File::mixin(new FileMixins());
$this->app->bind('command.blueprint.build', fn ($app) => new BuildCommand($app['files'], app(Builder::class)));
$this->app->bind('command.blueprint.erase', fn ($app) => new EraseCommand($app['files']));
$this->app->bind('command.blueprint.trace', fn ($app) => new TraceCommand($app['files'], app(Tracer::class)));
$this->app->bind('command.blueprint.new', fn ($app) => new NewCommand($app['files']));
<?php $this->app->bind('command.blueprint.build', fn ($app) => new BuildCommand($app['files'], app(Builder::class)));
$this->app->bind('command.blueprint.erase', fn ($app) => new EraseCommand($app['files']));
$this->app->bind('command.blueprint.trace', fn ($app) => new TraceCommand($app['files'], app(Tracer::class)));
$this->app->bind('command.blueprint.new', fn ($app) => new NewCommand($app['files']));
$this->app->bind('command.blueprint.init', fn ($app) => new InitCommand());
$this->app->bind('command.blueprint.stubs', fn ($app) => new PublishStubsCommand());
<?php return null;
}
return app($class);
}
private function extractColumns(Model $model)
<?php config(['blueprint.models_namespace' => '']);
$this->assertEquals($method->invoke(new Tracer(), app('App\Comment')), 'Comment');
$this->assertEquals($method->invoke(new Tracer(), app('App\Something\Tag')), 'Something\Tag');
<?php config(['blueprint.models_namespace' => '']);
$this->assertEquals($method->invoke(new Tracer(), app('App\Comment')), 'Comment');
$this->assertEquals($method->invoke(new Tracer(), app('App\Something\Tag')), 'Something\Tag');
config(['blueprint.models_namespace' => 'Models']);
<?php config(['blueprint.models_namespace' => 'Models']);
$this->assertEquals($method->invoke(new Tracer(), app('App\Models\Comment')), 'Comment');
$this->assertEquals($method->invoke(new Tracer(), app('App\Something\Tag')), 'Something\Tag');
}
<?php config(['blueprint.models_namespace' => 'Models']);
$this->assertEquals($method->invoke(new Tracer(), app('App\Models\Comment')), 'Comment');
$this->assertEquals($method->invoke(new Tracer(), app('App\Something\Tag')), 'Something\Tag');
}
public function it_passes_the_command_path_to_tracer()