lundi 11 février 2019

Why route() function does now works using laravel?

In my laravel package the route does not working it is showing following incorrect route in debugger

Request URL: http://localhost:8000/%7B%7B%20route('contact')%20%7D%7D

However my route is as following

Route::group(['namespace' => 'ayazdev\Contact\Http\Controllers'], function(){
    Route::get('contact', 'ContactController@index')->name('contact');
    Route::post('contact', 'ContactController@send')->name('sendForm');
});

And following is where I am calling the route

$(function(){
    $("#contact-form").submit(function(e) {
        var form = $(this);
        $.ajax({
               type: "POST",
               url: "",
               data: form.serialize(), 
               success: function(data)
               {
                   alert(data); 
               }
             });
        e.preventDefault(); 
    });
});

if above detail does not enough to understand then you can kindly check it on github.

Can someone kindly guide me why it is now working, I will appreciate. Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire