Nwidart\Modules\Repository::setUsed PHP Method

setUsed() public method

Set module used for cli session.
public setUsed ( $name )
$name
    public function setUsed($name)
    {
        $module = $this->findOrFail($name);
        $this->app['files']->put($this->getUsedStoragePath(), $module);
    }

Usage Example

 /** @test */
 public function it_sets_used_module()
 {
     $this->repository->addLocation(__DIR__ . '/stubs/Recipe');
     $this->repository->setUsed('Recipe');
     $this->assertEquals('Recipe', $this->repository->getUsed());
     $this->assertEquals('Recipe', $this->repository->getUsedNow());
 }