laravel NotFoundHttpException在AbstractRouteCollection和Application.php中

laravel NotFoundHttpException在AbstractRouteCollection和Application.php中,laravel,Laravel,拉雷维尔:7.28.0 “php”:“^7.2.5” 当我输入任何链接时,会出现以下错误: Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /home/mick/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1064 及 路由文件 api.php->Empty web.php Route::get('/', 'Home

拉雷维尔:7.28.0

“php”:“^7.2.5”

当我输入任何链接时,会出现以下错误:

Symfony\Component\HttpKernel\Exception\NotFoundHttpException in /home/mick/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1064

路由文件

api.php->Empty

web.php

     Route::get('/', 'HomeController@index')->name('home');

    Route::get('/clear', 'HomeController@clearCache')->name('clear_cache');

    Route::get('/installations', 'InstallationController@installations')->name('installations');
    Route::get('/installations/step/2', 'InstallationController@installationsTwo')->name('installations_step_two');
    Route::post('/installations/step/2', 'InstallationController@installationPost');
    Route::get('/installations/step/final', 'InstallationController@installationFinal')->name('installation_final');

/**
 * Authentication
 */

    Route::get('/login', 'AuthController@login')->name('login')->middleware('guest');
    Route::post('/login', 'AuthController@loginPost');
    Route::any('/logout', 'AuthController@logoutPost')->name('logout');

    Route::get('/register', 'AuthController@register')->name('register')->middleware('guest');
    Route::post('/register', 'AuthController@registerPost');
    

    Route::get('/forgot-password', 'AuthController@forgotPassword')->name('forgot_password');
    Route::post('/forgot-password', 'AuthController@sendResetToken');
    Route::get('/forgot-password/reset/{token}', 'AuthController@passwordResetForm')->name('reset_password_link');
    Route::post('/forgot-password/reset/{token}', 'AuthController@passwordReset');

    Route::get('/profile/{id}', 'UserController@profile')->name('profile');
    Route::get('/review/{id}', 'UserController@review')->name('review');

    Route::get('/courses', 'HomeController@courses')->name('courses');
    Route::get('/featured-courses', 'HomeController@courses')->name('featured_courses');
    Route::get('/popular-courses', 'HomeController@courses')->name('popular_courses');

    Route::get('/courses/{slug?}', 'CourseController@view')->name('course');
    Route::get('/courses/{slug}/lecture/{lecture_id}', 'CourseController@lectureView')->name('single_lecture');
    Route::get('/courses/{slug}/assignment/{assignment_id}', 'CourseController@assignmentView')->name('single_assignment');
    Route::get('/courses/{slug}/quiz/{quiz_id}', 'QuizController@quizView')->name('single_quiz');

    Route::get('/topics', 'CategoriesController@home')->name('categories');
    Route::get('/topics/{category_slug}', 'CategoriesController@show')->name('category_view');
//Get Topics Dropdown for course creation category select
    Route::post('/get-topic-options', 'CategoriesController@getTopicOptions')->name('get_topic_options');

    Route::post('/courses/free-enroll', 'CourseController@freeEnroll')->name('free_enroll');

//Attachment Download
    Route::get('/attachment-download/{hash}', 'CourseController@attachmentDownload')->name('attachment_download');

    Route::get('/payment-thank-you/{transaction_id?}', 'PaymentController@thankYou')->name('payment_thank_you_page');

    Route::group(['prefix' => 'login'], function () {
        //Social login route
        Route::get('/facebook', 'AuthController@redirectFacebook')->name('facebook_redirect');
        Route::get('/facebook/callback', 'AuthController@callbackFacebook')->name('facebook_callback');

        Route::get('/google', 'AuthController@redirectGoogle')->name('google_redirect');
        Route::get('/google/callback', 'AuthController@callbackGoogle')->name('google_callback');

        Route::get('/twitter', 'AuthController@redirectTwitter')->name('twitter_redirect');
        Route::get('/twitter/callback', 'AuthController@callbackTwitter')->name('twitter_callback');

        Route::get('/linkedin', 'AuthController@redirectLinkedIn')->name('linkedin_redirect');
        Route::get('/linkedin/callback', 'AuthController@callbackLinkedIn')->name('linkin_callback');
    });

    Route::group(['middleware' => ['auth']], function () {
        Route::post('/courses/{slug}/assignment/{assignment_id}', 'CourseController@assignmentSubmitting');
        Route::get('/content_complete/{content_id}', 'CourseController@contentComplete')->name('content_complete');
        Route::post('/courses-complete/{course_id}', 'CourseController@complete')->name('course_complete');

        Route::group(['prefix' => 'checkout'], function () {
            Route::get('/', 'CartController@checkout')->name('checkout');
            Route::post('/bank-transfer', 'GatewayController@bankPost')->name('bank_transfer_submit');
            Route::post('/paypal', 'GatewayController@paypalRedirect')->name('paypal_redirect');
            Route::post('/offline', 'GatewayController@payOffline')->name('pay_offline');
        });

        Route::post('/save-review/{course_id?}', 'CourseController@writeReview')->name('save_review');
        Route::post('/update-wishlist', 'UserController@updateWishlist')->name('update_wish_list');

        Route::post('/discussion/ask-question', 'DiscussionController@askQuestion')->name('ask_question');
        Route::post('/discussion/reply/{id}', 'DiscussionController@replyPost')->name('discussion_reply_student');

        Route::post('/quiz-start', 'QuizController@start')->name('start_quiz');
        Route::get('/quiz/{id}', 'QuizController@quizAttempting')->name('quiz_attempt_url');
        Route::post('/quiz/{id}', 'QuizController@answerSubmit');

        //Route::get('quiz/answer/submit', 'QuizController@answerSubmit')->name('quiz_answer_submit');

    });

/**
 * Add and remove to Cart
 */
    Route::post('/add-to-cart', 'CartController@addToCart')->name('add_to_cart');
    Route::post('/remove-cart', 'CartController@removeCart')->name('remove_cart');

/**
 * Payment Gateway Silent Notification
 * CSRF verification skipped
 */
    Route::group(['prefix' => 'gateway-ipn'], function () {
        Route::post('/stripe', 'GatewayController@stripeCharge')->name('stripe_charge');
        Route::any('/paypal/{transaction_id?}', 'IPNController@paypalNotify')->name('paypal_notify');
    });
    Route::group(['prefix' => 'dashboard', 'middleware' => ['auth']], function () {
        Route::get('/', 'DashboardController@index')->name('dashboard');

        /**
         * Only instructor has access in this group
         */
        Route::group(['middleware' => ['instructor'], ['admin']], function () {

            Route::post('/update-section/{id}', 'CourseController@updateSection')->name('update_section');
            Route::post('/delete-section', 'CourseController@deleteSection')->name('delete_section');

            Route::group(['prefix' => 'courses'], function () {
                Route::get('/new', 'CourseController@create')->name('create_course');
                Route::post('/new', 'CourseController@store');

                Route::get('/p/{course_id}/information', 'CourseController@information')->name('edit_course_information');
                Route::post('/p/{course_id}/information', 'CourseController@informationPost');

                Route::group(['prefix' => '{course_id}/curriculum'], function () {
                    Route::get('/', 'CourseController@curriculum')->name('edit_course_curriculum');
                    Route::get('/new-section', 'CourseController@newSection')->name('new_section');
                    Route::post('/new-section', 'CourseController@newSectionPost');

                    Route::post('/new-lecture', 'CourseController@newLecture')->name('new_lecture');
                    Route::post('/update-lecture/{id}', 'CourseController@updateLecture')->name('update_lecture');

                    Route::post('/new-assignment', 'CurriculumController@newAssignment')->name('new_assignment');
                    Route::post('/update-assignment/{id}', 'CurriculumController@updateAssignment')->name('update_assignment');

                    Route::group(['prefix' => 'quiz'], function () {
                        Route::post('/create', 'QuizController@newQuiz')->name('new_quiz');
                        Route::post('/update/{id}', 'QuizController@updateQuiz')->name('update_quiz');

                        Route::post('/{quiz_id}/create-question', 'QuizController@createQuestion')->name('create_question');
                    });
                });

                Route::post('/quiz/edit-question', 'QuizController@editQuestion')->name('edit_question_form');
                Route::post('/quiz/update-question', 'QuizController@updateQuestion')->name('edit_question');
                Route::post('/load-quiz-questions', 'QuizController@loadQuestions')->name('load_questions');
                Route::post('/sort-questions', 'QuizController@sortQuestions')->name('sort_questions');
                Route::post('/delete-question', 'QuizController@deleteQuestion')->name('delete_question');
                Route::post('/delete-option', 'QuizController@deleteOption')->name('option_delete');

                Route::post('/edit-item', 'CourseController@editItem')->name('edit_item_form');
                Route::post('/delete-item', 'CourseController@deleteItem')->name('delete_item');
                Route::post('/curriculum_sort', 'CurriculumController@sort')->name('curriculum_sort');

                Route::post('/delete-attachment', 'CurriculumController@deleteAttachment')->name('delete_attachment_item');

                Route::post('/load-section-items', 'CourseController@loadContents')->name('load_contents');

                Route::get('/p/{id}/pricing', 'CourseController@pricing')->name('edit_course_pricing');
                Route::post('/p/{id}/pricing', 'CourseController@pricingSet');
                Route::get('/p/{id}/drip', 'CourseController@drip')->name('edit_course_drip');
                Route::post('/p/{id}/drip', 'CourseController@dripPost');
                Route::get('/p/{id}/publish', 'CourseController@publish')->name('publish_course');
                Route::post('/p/{id}/publish', 'CourseController@publishPost');
            });

            Route::get('/my-courses', 'CourseController@myCourses')->name('my_courses');
            Route::get('/my-courses-reviews', 'CourseController@myCoursesReviews')->name('my_courses_reviews');

            Route::group(['prefix' => 'courses-has-quiz'], function () {
                Route::get('/', 'QuizController@quizCourses')->name('courses_has_quiz');
                Route::get('/quizzes/{id}', 'QuizController@quizzes')->name('courses_quizzes');
                Route::get('/attempts/{quiz_id}', 'QuizController@attempts')->name('quiz_attempts');
                Route::get('/attempt/{attempt_id}', 'QuizController@attemptDetail')->name('attempt_detail');
                Route::post('/attempt/{attempt_id}', 'QuizController@attemptReview');
            });

            Route::group(['prefix' => 'assignments'], function () {
                Route::get('/', 'AssignmentController@index')->name('courses_has_assignments');
                Route::get('/course/{course_id}', 'AssignmentController@assignmentsByCourse')->name('courses_assignments');
                Route::get('/submissions/{assignment_id}', 'AssignmentController@submissions')->name('assignment_submissions');
                Route::get('/submission/{submission_id}', 'AssignmentController@submission')->name('assignment_submission');
                Route::post('/submission/{submission_id}', 'AssignmentController@evaluation');
            });

            Route::group(['prefix' => 'earning'], function () {
                Route::get('/', 'EarningController@earning')->name('earning');
                Route::get('/report', 'EarningController@earningReport')->name('earning_report');
            });
            Route::group(['prefix' => 'withdraw'], function () {
                Route::get('/', 'EarningController@withdraw')->name('withdraw');
                Route::post('/', 'EarningController@withdrawPost');

                Route::get('/preference', 'EarningController@withdrawPreference')->name('withdraw_preference');
                Route::post('/preference', 'EarningController@withdrawPreferencePost');
            });

            Route::group(['prefix' => 'discussions'], function () {
                Route::get('/', 'DiscussionController@index')->name('instructor_discussions');
                Route::get('/reply/{id}', 'DiscussionController@reply')->name('discussion_reply');
                Route::post('/reply/{id}', 'DiscussionController@replyPost');

            });
        });

        Route::group(['prefix' => 'media'], function () {
            Route::post('/upload', 'MediaController@store')->name('post_media_upload');
            Route::get('/load_filemanager', 'MediaController@loadFileManager')->name('load_filemanager');
            Route::post('/delete', 'MediaController@delete')->name('delete_media');
        });

        Route::group(['prefix' => 'settings'], function () {
            Route::get('/', 'DashboardController@profileSettings')->name('profile_settings');
            Route::post('/', 'DashboardController@profileSettingsPost');

            Route::get('/reset-password', 'DashboardController@resetPassword')->name('profile_reset_password');
            Route::post('/reset-password', 'DashboardController@resetPasswordPost');
        });

        Route::get('/enrolled-courses', 'DashboardController@enrolledCourses')->name('enrolled_courses');
        Route::get('/reviews-i-wrote', 'DashboardController@myReviews')->name('reviews_i_wrote');
        Route::get('/wishlist', 'DashboardController@wishlist')->name('wishlist');

        Route::get('/my-quiz-attempts', 'QuizController@myQuizAttempts')->name('my_quiz_attempts');

        Route::group(['prefix' => 'purchases'], function () {
            Route::get('/', 'DashboardController@purchaseHistory')->name('purchase_history');
            Route::get('/view/{id}', 'DashboardController@purchaseView')->name('purchase_view');
        });

    });
此问题在我不使用路由缓存时发生
但是,当我获取路由缓存时,它在所有站点或任何路径上都不起作用,然后它会给出以下错误:for home path

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
The GET method is not supported for this route. Supported methods: HEAD.

是否有任何解决方案或程序可供我遵循以解决此问题?

您尝试访问哪个路径?我尝试访问路径,但所有路径都有相同的问题,您无法访问public,因为1。-这是一个目录。第二,我没有足够的时间浏览您的整个路线列表,但据我所知,您没有定义路线。不过,您不能访问public,它也将在生产中返回404。另外,请接受我的编辑。谢谢您的帮助,我现在该怎么办?解决这个问题?
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
The GET method is not supported for this route. Supported methods: HEAD.