tgif
4 years ago

Laracast - bulk file uploads - syntax question

Posted 4 years ago by tgif

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 sign in or create an account to participate in this conversation.