pcosta94 - 3 weeks ago

In my ServiceProvider i have this:

protected $routes = [ 'videos' => 'Anomaly\VideosModule\Http\Controller\VideosController@index', 'videos/watch/{slug}' => [ 'as' => 'anomaly.module.videos::videos.view', 'uses' => 'Anomaly\VideosModule\Http\Controller\VideosController@view' ], ];

And I have the bindings: protected $bindings = [ VideosCategoriasEntryModel::class => CategoriaModel::class, VideosSeriesEntryModel::class => SeriesModel::class, VideosVideosEntryModel::class => VideoModel::class ];

But in twig when I do this: {{ html_link(video.route('view'), video.description) }} The link don't go to the route but to base route of mywebsite.

Can anyone help me?

Answer

pcosta94 - 2 weeks ago

Hi, The problem is solved. There was a missing import class in my ModuleServiceProvider file.

ryanthompson - 3 weeks ago

Can you confirm your service provider is running? The addon is installed/enabled? Maybe add a register method and dd() in it to confirm. This is in your addons/ directory then?

pcosta94 - 3 weeks ago

The addon is installed. I'm following your tutorial video about modules. @ryanthompson

pcosta94 - 2 weeks ago

Hi, The problem is solved. There was a missing import class in my ModuleServiceProvider file.