Level 9
thats just the syntax you use to reference a variable in a string :) @csuarez
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys, Jeff has this line of code in the controller that is throwing me off. He uses 2 curly brackets on the final line to encapsulate var $name. Is that Blade within the php code???
public function addPhoto($zip, $street, request $request) {
$file = $request->file('file');
$name = time() . $file->getClientOriginalName();
$file->move("flyers/photos", $name);
$flyer = Flyer::locatedAt($zip, $street)->first();
$flyer->photos()->create(['path' => "/flyers/photos/{$name}"]);
}
Please or to participate in this conversation.