亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

開發部署抱怨關閉

開發部署抱怨關閉

PHP
慕沐林林 2022-10-14 10:38:13
我跑了deb deploy,它到了這一點。  The command "/usr/bin/php ~/NetTube/releases/1/artisan optimize" failed.  Exit Code: 1 (General error)  Host Name: 68.183.20.108  ================  Configuration cache cleared!  Configuration cached successfully!  Route cache cleared!  In Route.php line 917:    Unable to prepare route [api/user] for serialization. Uses Closure.我已經研究過了,似乎我不能在路由中使用閉包,這很好。我只是不確定如何防止關閉。這是我的 web.php<?php/*|--------------------------------------------------------------------------| Web Routes|--------------------------------------------------------------------------|| Here is where you can register web routes for your application. These| routes are loaded by the RouteServiceProvider within a group which| contains the "web" middleware group. Now create something great!|*/// Route::get('/', function () {//     return view('welcome');// });Route::get('/','HomeController@index')->name('home');Auth::routes();// Route::get('/home', 'HomeController@index')->name('home');Route::group(['middleware' => ['auth']], function(){    Route::get('/upload','VideoUploadController@index');    Route::get('/channel/{channel}/edit','ChannelSettingsController@edit');    Route::put('/channel/{channel}/edit','ChannelSettingsController@update');});Route::get('/channel/{channel}','ChannelController@index');Route::get('/{channel}','ChannelController@index');我已經嘗試將路線不在一個組中Route::get('/upload', [    'uses' => 'VideoUploadController@index',    'middleware' => ['auth'],]);Route::get('/channel/{channel}/edit', [    'uses' => 'ChannelSettingsController@edit',    'middleware' => ['auth'],]);Route::put('/channel/{channel}/edit', [    'uses' => 'ChannelSettingsController@update',    'middleware' => ['auth'],]);我正在運行 laravel 6.17.1。我希望我向任何可以提供幫助的人提供了足夠的信息。
查看完整描述

1 回答

?
溫溫醬

TA貢獻1752條經驗 獲得超4個贊

問題出在routes\api.php.

做類似的事情Route::middleware('auth:api')->get('/user', 'MyProfileController@index');。此路由需要綁定到控制器。如果您不需要該路線,請評論或刪除它。


查看完整回答
反對 回復 2022-10-14
  • 1 回答
  • 0 關注
  • 108 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號