Laravel项目中的'NotFoundHttpException'

时间:2017-08-04 08:46:30

标签: laravel deployment server routes

我尝试使用FTP上传我的Laravel项目,我做了一个作曲家更新并将服务器的PHP版本更改为7.但是我收到了'NotFoundHttpException'错误。有人可以帮助我吗?我只是学习Laravel并部署一个项目。我使用了hostinger。提前谢谢。

抱歉,找不到您要查找的页面。

(1/1)NotFoundHttpException 在RouteCollection.php(第179行)

在RouteCollection->匹配(对象(请求)) 在Router.php中(第548行)

在Router-> findRoute(对象(请求)) 在Router.php中(第527行)

在Router-> dispatchToRoute(object(Request)) 在Router.php中(第513行)

在Router-> dispatch(对象(请求)) 在Kernel.php中(第176行)

at Kernel-> Illuminate \ Foundation \ Http {closure}(object(Request)) 在Pipeline.php(第30行)

at Pipeline-> Illuminate \ Routing {closure}(object(Request)) 在TransformsRequest.php(第30行)

在TransformsRequest->句柄(对象(Request),对象(Closure)) 在Pipeline.php中(第148行)

at Pipeline-> Illuminate \ Pipeline {closure}(object(Request)) 在Pipeline.php中(第53行)

at Pipeline-> Illuminate \ Routing {closure}(object(Request)) 在TransformsRequest.php(第30行)

在TransformsRequest->句柄(对象(Request),对象(Closure)) 在Pipeline.php中(第148行)

at Pipeline-> Illuminate \ Pipeline {closure}(object(Request)) 在Pipeline.php中(第53行)

at Pipeline-> Illuminate \ Routing {closure}(object(Request)) 在ValidatePostSize.php(第27行)

在ValidatePostSize->句柄(对象(Request),对象(Closure)) 在Pipeline.php中(第148行)

at Pipeline-> Illuminate \ Pipeline {closure}(object(Request)) 在Pipeline.php中(第53行)

at Pipeline-> Illuminate \ Routing {closure}(object(Request)) 在CheckForMaintenanceMode.php(第46行)

在CheckForMaintenanceMode->句柄(对象(Request),对象(Closure)) 在Pipeline.php中(第148行)

at Pipeline-> Illuminate \ Pipeline {closure}(object(Request)) 在Pipeline.php中(第53行)

at Pipeline-> Illuminate \ Routing {closure}(object(Request)) 在Pipeline.php中(第102行)

在Pipeline->然后(object(Closure)) 在Kernel.php中(第151行)

at Kernel-> sendRequestThroughRouter(object(Request)) 在Kernel.php(第116行)

at Kernel-> handle(object(Request)) 在index.php(第53行)

<?php

Route::get('index', function () {
    return view('index.index');
});

Route::get('signup', function () {
    return view('auth.signup');
});

Route::get('choose-signup', 'EmployerLoginController@create');
Route::post('choose-signup', 'EmployerLoginController@store');

Route::get('register-emp', function(){
    return view('Auth.register-emp');
});

Route::post('register-emp', 'RegEmpController@store');

// --- 

Route::get('home', 'HomeController@index');
Auth::routes(); // --- 

// employer
Route::get('logs', 'Auth\EmployerLoginController@showLoginForm');
Route::post('logs', 'Auth\EmployerLoginController@login')->name('logss');


Route::get('employer', 'EmployerController@index')->name('emp');
// employer

// *******W O R K E X P E R I E N C E**************

Route::get('profile', 'WorkExperienceController@index')->middleware('auth');
Route::post('profile/add','WorkExperienceController@store');
Route::get('resume', 'WorkExperienceController@create')->middleware('auth');
Route::post('resume/{id}', 'WorkExperienceController@update');
Route::get('resume/{id}', 'WorkExperienceController@destroy');

// **********E D U C A T I O N***********

Route::post('profile/added','AddEducationController@store')->middleware('auth');
Route::post('profile/{id}', 'AddEducationController@update');
Route::get('profile/{id}', 'AddEducationController@destroy');

//*********S K I L L S******************
Route::post('skill/added','AddSkillsController@store')->middleware('auth');
Route::post('skill/{id}','AddSkillsController@update');
Route::get('skill/{id}', 'AddSkillsController@destroy');


//********* S E M I N A R S******************
Route::post('profileaddsem','AddSeminarController@store')->middleware('auth');
Route::post('seminar/{id}','AddSeminarController@update');
Route::get('seminar/{id}', 'AddSeminarController@destroy');

//*********C O N T A C T I N F O******************


Route::get('jobseeker-signup', 'ContactInfocontroller@create');
Route::post('jobseeker-signup', 'ContactInfocontroller@store');
Route::post('contact/{id}','ContactInfocontroller@update');

Route::get('choose-signup2', 'JobseekerLoginController@index');
Route::post('choose-signup2', 'JobseekerLoginController@store');



// Route::get('/contact-info', function () {
//     return view('jobseeker-signup-partials.contact-info');
// });

// *****************I M A G E ***********************
Route::post('imgupdate','HomeController@update_avatar');

// ***************P O S T A J O B*************************

Route::get('jobsearch', 'PostJobController@index');
Route::post('jobsearch', 'PostJobController@index');

// ***************e d i t p o s t e d j o b************************

Route::post('posted/{id}', 'PostJobController@editJob');
Route::get('posted/{id}', 'PostJobController@destroy');


// ************J O B  P O S T******************
Route::get('jobpost/{id}','PostJobController@show');
// ****Click Apply**********
Route::post('jobpost','ApplicationController@store');
// ****Click Save**********
Route::post('save','ApplicationController@saveJob');
// ***********delete saved jobs*******************
Route::post('unsave/{id}','ApplicationController@destroy');

Route::get('applicants','PostJobController@applicants');

Route::post('pdf','WorkExperienceController@upload');


// ****************************************
Route::get('sendemail', function() {

    $data = array (
        'name' => 'Hello Email!',       

        );

        Mail::send('emails.welcome', $data, function($message){

        $message->from('cathcasumali@gmail.com','Hello');
        $message->to('caumali46@gmail.com')->subject('Hello');
        });

    return "Your email has been successfully sent";
});




Route::get('application', function(){
    return view('index.application');
});
Route::get('messages', function(){
    return view('index.messages');
});


// ***********E M P L O Y E R***********************

Route::get('employer-signup', 'EmployerSignupController@create');
Route::post('employer-signup', 'EmployerSignupController@store');


// Route::get('company-profile', 'PostJobController@create');
Route::post('employer/post', 'PostJobController@store');



// Route::prefix('employer')->group(function(){


//     Route::get('/login', 'Auth\EmployerLoginController@showLoginForm')->name('employer.login');
//     Route::post('/login', 'Auth\EmployerLoginController@login')->name('employer.login.submit');
//     Route::get('/', 'EmployerController@index')->name('company-profile');
// });



// Route::get('/login', function () {
//     return view('auth.login');
// });

// Route::get('/jobseeker-signup', function () {
//     return view('auth.jobseeker-signup');
// });
// Route::get('/company-profile', function(){
//     return view('index.company-profile');
// });


// Route::get('post', 'PostJobController@index');

2 个答案:

答案 0 :(得分:1)

根据您的评论:'嗨,这是我项目的网址....',您尝试访问的路线是'/'。通过快速浏览一下您的路径文件,这不存在。

我试过了http://cathumali.890m.com/index,这让我看到了一个看起来像头版的东西。如果这是预期的页面,我建议添加另一个路由,指向同一个控制器或修复路由到所有指向索引。

Route::get('/', function () {
    return view('index.index');
});

答案 1 :(得分:0)

编辑:正如mbozwood在评论中所述:两个相同的网址可以存在两种不同的方法

我不知道你是否真的可以创建两条具有相同URL但方法不同的路由(GET和POST),如下所示:

Route::get('choose-signup', 'EmployerLoginController@create');
Route::post('choose-signup', 'EmployerLoginController@store');

相反,请使用

Route::match(['get', 'post'], 'choose-signup', 'EmployerLoginController@signup');

在你的控制器方法中:

public function signup(Request $request)
{
    if ($request->isMethod('post'))
    { return redirect()->action('EmployerLoginController@store', ['request' => $request]); }
    else
    { return redirect()->action('EmployerLoginController@create'); }
}

这不是问题,但它很安静。