ControllerResourceRoute.php 1.1 KB
Newer Older
jhon committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
<?php

namespace Acacha\AdminLTETemplateLaravel\Console\Routes;

use Acacha\AdminLTETemplateLaravel\Compiler\StubFileCompiler;
use Acacha\AdminLTETemplateLaravel\Filesystem\Filesystem;

/**
 * Class ControllerResourceRoute.
 *
 * @package Acacha\AdminLTETemplateLaravel\Console\Routes
 */
class ControllerResourceRoute extends Route
{
    use Controller;

    /**
     * Route constructor.
     *
     * @param StubFileCompiler $compiler
     * @param Filesystem $filesystem
     */
    public function __construct(StubFileCompiler $compiler, Filesystem $filesystem)
    {
        parent::__construct($compiler, $filesystem);
    }

    /**
     * Get stub path.
     *
     * @return mixed
     */
    protected function getStubPath()
    {
        return __DIR__ . '/../stubs/route_with_resource_controller.stub';
    }

    /**
     * Obtain replacements for stub.
     *
     * @return mixed
     */
    protected function obtainReplacements()
    {
        return [
            'ROUTE_LINK' => $this->getReplacements()[0],
            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]),
        ];
    }
}