B
B
BonBon Slick2017-04-12 01:10:06
JavaScript
BonBon Slick, 2017-04-12 01:10:06

Route is undefined when is it declared?

OpenServer, Windows 10, PhPStrom 2017.
The situation arises with newly minted and modified routes.
We declare a Route in the web.php file.

Route::group(['prefix' => 'videos'], function () {
            Route::post('', 'Document\[email protected]')->name('document.videos.store');

Vue.js component, add() function sends via package laroute to our Route
add() {
                Slc.post(laroute.route('document.videos.store'), this.form)
                   .then((response) => {
                           alert('1233');

our route, if dumped, is undefined, like any other new / changed one.
An error in the console, it's not even really an error or a warning, written in white as a note:
TypeError: Cannot read property 'protocol' of undefined
    at isURLSameOrigin (app.467c5b6….js:41691)
    at dispatchXhrRequest (app.467c5b6….js:40404)
    at Promise (<anonymous>)
    at xhrAdapter (app.467c5b6….js:40308)
    at dispatchRequest (app.467c5b6….js:41297)

If you change the Route to any other, then everything is OK, the alert displays.
What I have tried:
// все разом, прошелся по всем
1 - очистил полностью кеш браузера
2- composer dump-autoload
3- php artisan cache:clear
4- php artisan route:clear
5- php artisan laroute:generate // необходимо юзать после создания новых Route, для индексации

edited .htaccess with the code that I read on the forum. There were suspicions something with Apache settings
Also ...store route is not in the route:list list
Alas, nothing helped, so what could be the problem, any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
ctpayc, 2017-04-20
@BonBonSlick

Route::post('', 'Document\[email protected]')->name('document.videos.store');

This is probably where your store route should be... Try this
Route::post(' store ', 'Document\[email protected]')->name('document.videos.store');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question