Level 122
you just want to know how to concatenate a string?
use a period between each part
$product->name = $request->ptype_id . $request->model_id . $request->brand_id;
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi i have an issue while identifying a product, i have three tables Products, Brands, and Models. Im trying to make my $product->name to be the value con concatenate the $product->brand + $product->name. Is that possible?
ProductController:
public function store(Request $request){
$product = new Product();
$product->ptype_id = $request->ptype_id;
$product->model_id = $request->model_id;
$product->brand_id = $request->brand_id;
$product->name = " "
$product->save();
Session::flash('success');
return redirect()->route('products.view');
}
Please or to participate in this conversation.