lonnieezell / myth-auth

One-stop Auth package for CodeIgniter 4
MIT License
632 stars 207 forks source link

fix error BaseFilter not found when use auth:publish #569

Closed hunter-and1 closed 1 year ago

hunter-and1 commented 2 years ago

update

src/Commands/Publish.php

    protected function publishFilters()
    {
        $filters = ['LoginFilter', 'PermissionFilter', 'RoleFilter'];

        foreach ($filters as $filter) {
            $path = "{$this->sourcePath}/Filters/{$filter}.php";

            $content = file_get_contents($path);
            $content = $this->replaceNamespace($content, 'Myth\Auth\Filters', 'Filters');
            $usingClasses = "use CodeIgniter\HTTP\ResponseInterface;\n";
            $newusingClasses = $usingClasses."use \Myth\Auth\Filters\BaseFilter;\n";
            $content = str_replace($usingClasses, $newusingClasses, $content);

            $this->writeFile("Filters/{$filter}.php", $content);
        }
    }
manageruz commented 2 years ago

Please fork the develop branch and make your PR from there.

manageruz commented 2 years ago

And replacement code not working.

manageruz commented 1 year ago

Closing as fixed by #575