Метод контроллера
public function create(Request $request )
{
$client_id = $request->input('client_name');
//$userid = \Auth::user()->id;
$invoice_id = Invoice::create([
//'userid'=>$userid,
'clientid'=>$client_id,
])->id;
return redirect('invoice/create/'.$invoice_id);
}
Просмотр Где я получаю ошибку
@if($invoice_product->product_qty!=null)
value="{{$invoice_product->product_qty}}"
@endif
Модель
namespace App;
use Illuminate\Database\Eloquent\Model;
class InvoiceProducts extends Model
{
protected $fillable = ['invoice_id'];
}
и ошибка Неопределенная переменная: invoice_product (View: C: \ xampp \ htdocs \ cs \ resources \ views \ invoice \ create.blade.php)