简体   繁体   English

未在Laravel中为错误创建日志文件ID

[英]Log file id not created for error in Laravel

I have a simple form in my Laravel site for asking questions. 我在Laravel网站上有一个简单的表格来询问问题。

While I have submitted the form using Ajax I have got error in my console like below 当我使用Ajax提交表单时,在控制台中出现如下错误

GET http://localhost/sencare_v2/ask-question-form-submit?first_name=shbshb&last_name=bhbh&email=hbhbh%40gmail.com&contact=5454&question=hbdndjnkdnjdnkdj&_token=aMg6TGCXdHYpjQ2qZP4RxhEIuTmKUHih6seg5kdm 404 (Not Found) 获取http:// localhost / sencare_v2 / ask-question-form-submit?first_name = shbshb&last_name = bhbh&email = hbhbh%40gmail.com&contact = 5454&question = hbdndjnkdnjdnkdj&_token = aMg6TGCXdHYpjQ2qZP4R404

For getting the details of that error I have visited in my log file in storage/logs ... 为了获取该错误的详细信息,我已经在storage/logs日志文件中访问了该文件...

But no file created regarding this error issue. 但是没有关于此错误问题的文件创建。

html form html表格

<form id="ask_question_form" class="rd-mailform text-left" data-form-output="form-output-global" data-form-type="contact" action="" novalidate="novalidate">
    <input type="hidden" name="_token" id="csrf-token" value="{{ Session::token() }}" />
    <div class="range range-xs-center">
        <div class="cell-sm-6">
            <div class="form-group form-group-label-outside">
                <input class="form-control form-control-last-child" id="ask_question_first_name" type="text" name="first-name" data-constraints="@Required" placeholder="First Name"><span class="form-validation"></span>
            </div>
            <div class="form-group form-group-label-outside offset-top-20">
                <input class="form-control form-control-last-child" id="ask_question_email" type="email" name="email" data-constraints="@Email @Required" placeholder="Email"><span class="form-validation"></span>
            </div>
        </div>
        <div class="cell-sm-6 offset-top-20 offset-sm-top-0">
            <div class="form-group form-group-label-outside">
                <input class="form-control form-control-last-child" id="ask_question_last_name" type="text" name="last-name" data-constraints="@Required" placeholder="Last Name"><span class="form-validation"></span>
            </div>
            <div class="form-group form-group-label-outside offset-top-20">
                <input class="form-control form-control-last-child" id="ask_question_contact_no" type="text" name="last-name" data-constraints="@IsNumeric @Required" placeholder="Contact No"><span class="form-validation"></span>
            </div>
        </div>
    </div>
    <div class="form-group form-group-label-outside padding-top-20">
        <textarea class="form-control form-control-last-child" id="ask_question_message" name="message" data-constraints="@Required" style="max-height: 150px;" placeholder="Question"></textarea><span class="form-validation"></span>
    </div>
    <div class="offset-top-18 offset-sm-top-30 text-center text-sm-left">
        <button id="ask_question_submit_button" class="btn btn-ellipse btn-primary" type="button" style="min-width: 130px;">send message</button>
    </div>
</form>

ajax part 阿贾克斯部分

$.get('ask-question-form-submit', {'first_name': ask_question_first_name, 'last_name': ask_question_last_name, 'email': ask_question_email, 'contact': ask_question_contact_no, 'question': ask_question_message, '_token':$('input[name=_token]').val()}, function(data)
    {}

web.php inside routes/ 路线内的web.php routes/

Route::get('/ask-question-form-submit/{data}', 'homeController@ask_question_form');

How to solve this? 如何解决呢? Anybody help please ? 有人帮忙吗?

Thanks in advance 提前致谢

Regarding the log issue. 关于日志问题。 It's not there because nothing in Laravel broke down. 它不存在,因为Laravel中没有任何故障。 This is simply js telling you that it didn't find the route you gave it. 这只是用js告诉您,它没有找到您给它的路线。 Wouldn't it be better to submit your form with post request. 随函附上您的表格会更好。 You would have to change ajax to post and also your route type. 您将不得不更改ajax来发布以及您的路线类型。 Remove the /{data} part and see if it works. 删除/ {data}部分,看看它是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM