There is one page in our laravel project. which Hereis giving this error. We are not understanding why this error is coming.
I tried to dd()
$consignments
variable in controller it shows result but on blade console it gives this error
GET http://url/invoices/create_consignment_invoice/318 500 (Internal Server Error)
Here is Controller function
{
$invoice = Invoice::find($id);
// ->doesnthave('invoice_charges')
// ->
$consignments = Consignment::where('customer_id', $invoice->customer_id)->doesnthave('invoice_charges')->get();
// $consignments = Consignment::where('customer_id', $invoice->customer_id)->doesnthave('invoice_charges')->get();
// ->whereDate('created_at', '>', Carbon::now()->subDays(10))
return view('web.admin.pages.misc.invoices.consignment_invoices.create', compact('consignments', 'invoice'));
}
Route
Route::get('/create_consignment_invoice/{invoice_id}', 'Admin\Misc\InvoiceController@createConsignmentInvoice')->name('invoices.consignment.create');
invoice
public function invoice_charges()
{
return $this->hasOne('App\Models\Admin\InvoiceCharge', 'object_id')->where('model', 'Consignment');
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire