簡體   English   中英

未在Laravel中為錯誤創建日志文件ID

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

我在Laravel網站上有一個簡單的表格來詢問問題。

當我使用Ajax提交表單時,在控制台中出現如下錯誤

獲取http:// localhost / sencare_v2 / ask-question-form-submit?first_name = shbshb&last_name = bhbh&email = hbhbh%40gmail.com&contact = 5454&question = hbdndjnkdnjdnkdj&_token = aMg6TGCXdHYpjQ2qZP4R404

為了獲取該錯誤的詳細信息,我已經在storage/logs日志文件中訪問了該文件...

但是沒有關於此錯誤問題的文件創建。

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>

阿賈克斯部分

$.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 routes/

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

如何解決呢? 有人幫忙嗎?

提前致謝

關於日志問題。 它不存在,因為Laravel中沒有任何故障。 這只是用js告訴您,它沒有找到您給它的路線。 隨函附上您的表格會更好。 您將不得不更改ajax來發布以及您的路線類型。 刪除/ {data}部分,看看它是否有效。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM