protected function load(string $path): void
    {
        $namespace = $this->app->getNamespace();

        /** @var SplFileInfo[] $files */
        $files = (new Finder)->in($path)->files();

        foreach ($files as $file) {
            $file = $namespace.str_replace(
                    ['/', '.php'],
                    ['\\', ''],
                    Str::after($file->getPathname(), app_path().DIRECTORY_SEPARATOR)
                );

            if (is_subclass_of($file, Intent::class) && !(new ReflectionClass($file))->isAbstract()) {
                $this->app['conversation']->registerIntent($file);
            }
        }
    }
protected function load(string $path): void
    {
        $namespace = $this->app->getNamespace();

        /** @var SplFileInfo[] $files */
        $files = (new Finder)->in($path)->files();

        foreach ($files as $file) {
            $file = $namespace.str_replace(
                    ['/', '.php'],
                    ['\\', ''],
                    Str::after($file->getPathname(), app_path().DIRECTORY_SEPARATOR)
                );

            if (is_subclass_of($file, Intent::class) && !(new ReflectionClass($file))->isAbstract()) {
                $this->app['conversation']->registerIntent($file);
            }
        }
    }
protected function load ( string $ path ) : void { $ namespace = $ this -> app -> getNamespace ( ) ; /** @var SplFileInfo[] $files */ $ files = ( new Finder ) -> in ( $ path ) -> files ( ) ; foreach ( $ files as $ file ) { $ file = $ namespace . str_replace ( [ '/' , '.php' ] , [ '\\' , '' ] , Str :: after ( $ file -> getPathname ( ) , app_path ( ) . DIRECTORY_SEPARATOR ) ) ; if ( is_subclass_of ( $ file , Intent :: class ) && ! ( new ReflectionClass ( $ file ) ) -> isAbstract ( ) ) { $ this -> app [ 'conversation' ] -> registerIntent ( $ file ) ; } } }
Load intents from path.

@param string $path
Load intents from path .