mercredi 5 avril 2023

Type error: Too few arguments to function App\Http\Controllers\gst_billing\WOSBillingController::index(), 0 passed and exactly 1 expected

I have to show index page with corresponding id,when I dd() the query in index method I'm getting null

index method in controller

    public function index($id){
    
     $bill = DB::table('proforma_invoice as b')
                ->leftjoin('states as ss', 'ss.id', '=', 'b.shipping_state_id')
                ->leftjoin('countries as sco', 'sco.id', '=', 'ss.country_id')
                ->leftjoin('states as s', 's.id', '=', 'b.billing_state_id')
                ->leftjoin('countries as co', 'co.id', '=', 's.country_id')
                ->join('customer as c', 'c.id', '=', 'b.customer_id')
                ->select('b.billing_name', 'b.customer_id', 'b.*', 's.state_name', 'co.country_name', 'ss.state_name as shipping_state', 'sco.country_name as shipping_country')
                ->where('b.id', $id)
                ->first();
                
                dd($bill);
   return view('gst_billing.wos_billing.index')->with('bill',$bill);
    
    }

button from table that takes to index page with corresponding id:

 <a href="" title="Send to Invoice"><i class="fas fa-file-invoice"></i></a>

Route:

Route::get('/wos_billing/{id}',['as' => 'gst_billing.wos_billing.index', 'uses' => 'WOSBillingController@index'])->name('gst_billing.wos_billing.index');

can someone identitfy what I'm doing wrong here ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire