laravel8未定义变量:错误

时间:2020-10-27 08:15:29

标签: laravel eloquent sendgrid

我正在使用Vue js前端开发Laravel Api。我在验证电子邮件和重置密码时遇到问题。我正在使用sendGrid发送电子邮件,在“重置密码”按钮的电子邮件中,它会将我重定向到/ api / password / reset,并且此路由向我显示未定义变量:错误的异常(查看:/ reset.blade.php的路径 >与验证电子邮件相同,其重定向路由为api / email / verify /,这会在未定义变量:错误(查看:/login.blade.php 的路径”中显示错误异常。

api.php


    Route::middleware('auth:api')->get('/user', function (Request $request) {
        return $request->user();
    });
    
 

       Route::get('users/send-email', 'App\Http\Controllers\Api\UsersController@sendEMails');
        Route::post('client/search', 'App\Http\Controllers\Api\ClientsController@searchBy');
        Auth::routes(['verify' => true]);
        Route::apiResource('user', 'App\Http\Controllers\Api\UsersController');
        Route::apiResource('freelancer', 'App\Http\Controllers\Api\FreelancersController');
        Route::apiResource('client', 'App\Http\Controllers\Api\ClientsController');
        Route::apiResource('service', 'App\Http\Controllers\Api\ServicesController');
        Route::post('service/{id}', 'App\Http\Controllers\Api\ServicesController@update');
        Route::post('client/{id}', 'App\Http\Controllers\Api\ClientsController@update');
        Route::post('freelancer/{id}', 'App\Http\Controllers\Api\FreelancersController@update');
        
        Route::apiResource('contact_us', 'App\Http\Controllers\Api\ContactUsController');
        
        Route::post('clients/client-referal', 'App\Http\Controllers\Api\ClientsController@findReferal');
        
        Route::post('freelancers/search', 'App\Http\Controllers\Api\FreelancersController@searchBy');
        Route::post('services/search', 'App\Http\Controllers\Api\ServicesController@searchBy');
        
        // getting admin users for admin dashboard
        
        Route::get('users/admins', 'App\Http\Controllers\Api\UsersController@getAdminUsers');
        Route::apiResource('sales_methods', 'App\Http\Controllers\Api\SalesMethodsController');
        Route::apiResource('industries', 'App\Http\Controllers\Api\IndustriesController');
        
        Route::middleware('auth:sanctum')->group(function () {
            Route::apiResource('user_subscribe_client', 'App\Http\Controllers\Api\SubscribedUserClientsController');
            Route::apiResource('apply_job', 'App\Http\Controllers\Api\UserAppliedJobController');
            Route::get('users/setup-intent', 'App\Http\Controllers\Api\UsersController@getSetupIntent');
            Route::post('users/payments', 'App\Http\Controllers\Api\UsersController@postPaymentMethods');
            Route::post('clients/payments', 'App\Http\Controllers\Api\ClientsController@showMyPayments');
            Route::get('users/payment-methods', 'App\Http\Controllers\Api\UsersController@getPaymentMethods');
            Route::post('users/remove-payment', 'App\Http\Controllers\Api\UsersController@removePaymentMethod');
            Route::put('users/subscription', 'App\Http\Controllers\Api\UsersController@updateSubscription');
            Route::put('users/update-password/{id?}', 'App\Http\Controllers\Api\UsersController@updatePassword');
            Route::post('services/status', 'App\Http\Controllers\Api\ServicesController@changeStatus');
        });
    
**Web.php**
<pre>

Route::middleware('auth')->get('/user', function (Request $request) {
    return $request->user();
});

Auth::routes(['verify' => true]);
Route::get('/{any?}', function () {
    return view('welcome');
})->where('any', '^(?!api\/)[\/\w\.\,-]*');

Vuejs密码重置表单操作


    async resetPassword() {
          const post = { email: this.resetEmail };
          const response = await axios
            .post("/index.php/api/password/email", post).then((){
    further logic
    }).catch((){
    further logic
    })

0 个答案:

没有答案