N
N
Nikolai Steshenko2019-05-27 12:47:04
Laravel
Nikolai Steshenko, 2019-05-27 12:47:04

How to remove from CNC Action in Laravel?

I want to migrate my blog from wordpressa to laravel. The question arose about the implementation of CNC as one of the most important elements of the site. Now I have 2 types of addresses
(categories) on my blog

niksongames.ru/faq for

for articles
niksongames.ru/skachat-igru-steep-free-do-22-maya/

in web file Laravel only works
// если я пишу просто алиас, то даже если я изменю controller и Action будет ошибка
Route::get('/{alias}','[email protected]')->name('show');

Route::get('/thems/{alias}',' [email protected]')->name('category');

5cebb1f8f0320423119885.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Vorotnev, 2019-05-30
@niksongames

Based on the discussion in the comments,
It seems to me that this is achievable in only one way - one route and one controller for it, and already in the controller you will take the alias value and determine what to do next.

M
Mykola Ivashchuk, 2019-05-27
@mykolaim

Just swap these routes, i.e.

Route::get('/thems/{alias}',' [email protected]')->name('category');
Route::get('/{alias}','[email protected]')->name('show');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question