首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >缺少[路由: showbilling] [URI:{locale}/projects/{id}/billings]的必需参数

缺少[路由: showbilling] [URI:{locale}/projects/{id}/billings]的必需参数
EN

Stack Overflow用户
提问于 2019-05-15 02:31:20
回答 1查看 309关注 0票数 0

我认为这是我的项目的最后一个问题。我在1路由{locale}/projects/{id}/billings中有2个参数,问题是我在视图中传递了2个参数值,但它仍然提示缺少所需参数的错误。这是我的代码

web.php

代码语言:javascript
运行
复制
Route::group(['prefix' => '{locale}', 'where' => ['locale' => '[a-zA-Z]{2}'], 'middleware' => 'setlocale'], function () {

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

    return view('welcome');
    })->name('main');

    Auth::routes();

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

    //Customers
    Route::get('/customers', 'CustomerController@showcust')->name('customers');
    Route::post('/sendcust', 'CustomerController@sendcust')->name('sendcust');


    //Items
    Route::get('/items', 'ItemController@showitems')->name('items');
    Route::post('/senditem', 'ItemController@senditem')->name('senditem');

    //Projects
    Route::get('/projects', 'ProjectController@showprojects')->name('projects');
    Route::post('/sendproj', 'ProjectController@sendproj')->name('sendproj');
    //ProjectBillings
    Route::get('/projects/{id}/billings', 'ProjectController@showbilling')->name('showbilling');
    Route::post('/sendbilling', 'ProjectController@addbilling')->name('sendbilling');   

    //Invoices
    Route::get('/invoices', 'InvoiceController@showinvoice')->name('invoices');
    Route::post('/sendinvoitem', 'InvoiceController@sendinvoitem')->name('sendinvoitem');
    Route::get('/invoices/{id}/details', 'InvoiceController@showdetails');
    Route::post('/updateitem','InvoiceController@updatedetail')->name('updateitem');
    Route::get('invoices/{id}/generate', 'InvoiceController@generate');
    Route::post('/updatestatus', 'InvoiceController@changestatus')->name('updatestatus');

});

projects.blade.php

代码语言:javascript
运行
复制
<a href="{{route('showbilling', ['locale' => app()->getLocale(), 'id' => $cat->id])}}" class="btn btn-default btn-xs waves-effect waves-float waves-green"> {{__('Add Billing')}} </a>

ProjectController.php

代码语言:javascript
运行
复制
public function showbilling($locale, $id){
   $billings = Project::find($id);
   //return $billings;
   return view('admin.addbillings', compact('billings'));
}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56136522

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档