<?php echo Form::open(['method' => 'POST', 'url' => ['/cart/add/'. "{{$product->product_id }}"]] )?>
<?php echo Form::button('Agregar al Carro', ['class' => 'btn-u btn-u-sea-shop btn-u-lg', 'type' => 'submit']) ?>
<?php echo Form::close() ?>
I need to print the variable $product
in a template.
You can echo it with php like:
<?php echo $product->product_id ?>
and in blade syntax like:
{{$product->product_id}}
and in your case it should be like:
'url' => [ '/cart/add/'. $product->product_id ]
only concatenation is required here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With