本文整理汇总了PHP中app\Photo::fromFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Photo::fromFile方法的具体用法?PHP Photo::fromFile怎么用?PHP Photo::fromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Photo
的用法示例。
在下文中一共展示了Photo::fromFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addPhoto
public function addPhoto($zip, $street, AddPhotoRequest $request)
{
$photo = Photo::fromFile($request->file('photo'));
Flyer::locatedAt($zip, $street)->addPhoto($photo);
// $this->validate($request,[
// 'photo' => 'required|mimes:jpg,jpeg,png,bmp'
// ]);
//
//
// if(! $this->userCreatedFlyer($request))
// {
// return $this->unauthorized($request);
// }
// $photo = $this->makePhoto($request->file('photo'));
//
// Flyer::locatedAt($zip, $street)->addPhoto($photo);
}
示例2: addPhoto
public function addPhoto($zip, $street, AddPhotoRequest $request)
{
$photo = Photo::fromFile($request->file('photo'));
Flyer::locatedAt($zip, $street)->addPhoto($photo);
}
示例3: store
public function store(AddPhotoRequest $request)
{
$photo = Photo::fromFile($request->file('file'));
dd($photo);
}
示例4: store
/**
* Apply a photo to the referenced flyer
* @param $zip
* @param $street
* @param AddPhotoRequest $request
*/
public function store($zip, $street, AddPhotoRequest $request)
{
$photo = Photo::fromFile($request->file('file'));
//$photo = $this->makePhoto($request->file('file'));
Flyer::locatedAt($zip, $street)->addPhotos($photo);
}