當前位置: 首頁>>代碼示例>>PHP>>正文


PHP app\Flyer類代碼示例

本文整理匯總了PHP中app\Flyer的典型用法代碼示例。如果您正苦於以下問題:PHP Flyer類的具體用法?PHP Flyer怎麽用?PHP Flyer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Flyer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  FlyerRequest  $request
  * @return Response
  */
 public function store(FlyerRequest $request)
 {
     Flyer::create($request->all());
     flash()->success('Success!', 'Your flyer has been created');
     return redirect()->back();
     //temporary
 }
開發者ID:rjchauhan,項目名稱:project-flyer,代碼行數:13,代碼來源:FlyersController.php

示例2: addPhoto

 public function addPhoto($zip, $street, AddPhotoRequest $request)
 {
     $flyer = Flyer::locatedAt($zip, $street);
     $file = $request->file('file');
     $photo = $this->makePhoto($file);
     $flyer->savePhoto($photo);
 }
開發者ID:psylanrex,項目名稱:project-flyer,代碼行數:7,代碼來源:FlyersController.php

示例3: addPhoto

 public function addPhoto($zip, $street, Request $request)
 {
     $this->validate($request, ['photo' => 'required|mimes:jpg,jpeg,png,bmp']);
     $photo = Photo::fromForm($request->file('photo'));
     Flyer::locatedAt($zip, $street)->addPhoto($photo);
     //return view('flyers.show',compact('flyer'));
 }
開發者ID:sonfordson,項目名稱:Project-Flyer,代碼行數:7,代碼來源:FlyersController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(FlyerRequest $request)
 {
     Flyer::create($request->all());
     session()->flash('flash_message', 'Flyer successfully created');
     // flash messaging
     //return redirect()->back();
 }
開發者ID:zaiendi,項目名稱:ProjectFlyer,代碼行數:12,代碼來源:FlyersController.php

示例5: store

 /**
  * Apply a photo to the referenced flyer.
  * Uses a dedicated form request called AddPhotoRequest.
  *
  * @param string $zip
  * @param string $street
  * @param AddPhotoRequest $request
  */
 public function store($zip, $street, AddPhotoRequest $request)
 {
     // find our flyer
     $flyer = Flyer::locatedAt($zip, $street);
     // store the photo which will be just the UploadedFile instance
     $photo = $request->file('photo');
     // we'll have a dedicated class like AddPhotoToFlyer and it will accept the flyer and the photo upload
     // and if that's its own instance, then we need to new it up and call a save method on it
     // this is an alternative way to do this.
     // if we wanted to treat this as a form object, you could even do your validation within that class rather than here, but in this case its so easy im just going to leave it in
     // and you would no longer need the AddPhotoRequest here.
     // we need to create this. we'll put it in app/Forms/AddPhotoToFlyer
     // we put this in Forms because we are treating this as a forms object
     // or i might have a more dedicated namespace like app/Flyers/AddPhotoToFlyer
     // or if you want you could put it in app/AddPhotoToFlyer and that would be okay too. thats what we will do here.
     (new AddPhotoToFlyer($flyer, $photo))->save();
     // i like using a named constructor. that way i can new up a photo and pass in the columns essentially
     // or if i wanted to fetch these from (in this case) a file's request then its useful to use a named constructor.
     // we'll pass in the photo uploaded file.
     // built up our photo
     // $photo = Photo::fromFile($request->file('photo'))->upload();
     //$photo = Photo::fromFile($request->file('photo'));
     // then we pass the photo to our flyer
     // But what about the process where we upload the file to the proper directory?
     // yes we persist it in the database. but we also need to move it to the folder and create the thumbnail.
     // located the current flyer. associate it with this flyer and save it.
     //Flyer::locatedAt($zip, $street)->addPhoto($photo);
 }
開發者ID:adrianapope,項目名稱:project-flyer,代碼行數:36,代碼來源:PhotosController.php

示例6: store

 public function store($zip, $street, AddPhotoRequest $request)
 {
     $flyer = Flyer::locatedAt($zip, $street);
     $photo = $request->file('photo');
     (new AddPhotoToFlyer($flyer, $photo))->save();
     //$photo = Photo::fromFile($request->file('photo'));
     //Flyer::locatedAt($zip, $street)->addPhoto($photo);
 }
開發者ID:garyobrien92,項目名稱:project-flyer,代碼行數:8,代碼來源:PhotosController.php

示例7: addPhoto

 public function addPhoto($zip, $street, ChangeFlyerRequest $request)
 {
     if (!$this->userCreatedFlyer($request)) {
         return $this->unauthorized($request);
     }
     $photo = $this->makePhoto($request->file('photo'));
     Flyer::locatedAt($zip, $street)->addPhoto($photo);
 }
開發者ID:serrati,項目名稱:project-flyer,代碼行數:8,代碼來源:FlyersController.php

示例8: store

 public function store(FlyerRequest $request)
 {
     //persist the flyer
     Flyer::create($request->all());
     //flash messaging
     flash()->success('Success', 'Flyer was inserted with success!');
     //redirect to landing page
     return redirect()->back();
 }
開發者ID:andregoncalvesdev,項目名稱:laracasts-project-flyer,代碼行數:9,代碼來源:FlyersController.php

示例9: store

 /**
  * Store a new foto.
  *
  * @return \Illuminate\Http\Response
  */
 public function store($zip, $street, Request $request)
 {
     $flyer = Flyer::locatedAt($zip, $street);
     return Response::json($request->file(), 200);
     $photo = $request->file('file');
     $name = $photo->fileName();
     //$photo = Photo::fromFile($request->file('file'))->upload();
     $flyer->photos()->create(['path' => "/flyers/photos/{$name}"]);
 }
開發者ID:qnk,項目名稱:laravel-projectFlyer,代碼行數:14,代碼來源:PhotosController.php

示例10: addPhoto

 public function addPhoto($zip, $street, Request $request)
 {
     $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);
 }
開發者ID:naxjud,項目名稱:projectflyer,代碼行數:9,代碼來源:FlyersController.php

示例11: store

 public function store(Request $request, $zip, $street)
 {
     $this->validate($request, ['photo' => 'required|mimes:jpg,jpeg,png, bmp']);
     if (!$this->userCreatedFlyer($request)) {
         return $this->unauthorized($request);
     }
     $flyer = Flyer::locatedAt($zip, $street);
     $photo = $request->file('photo');
     (new AddPhotoToFlyer($flyer, $photo))->save();
 }
開發者ID:Jimbol4,項目名稱:project-flyer,代碼行數:10,代碼來源:PhotosController.php

示例12: addPhotos

 public function addPhotos($zip, $street, Request $request)
 {
     $this->validate($request, ['photo' => 'mimes:jpg,jpeg,png,bmp']);
     //$file = $request->file('photo'); // paramName
     //$file->move('flyers/photos', $name);
     //$flyer = Flyer::locatedAt($zip, $street)->first();
     $photo = $this->makePhoto($request->file('photo'));
     Flyer::locatedAt($zip, $street)->addPhoto($photo);
     //$flyer->photos()->create(['path' => "flyers/photos/{$name}"]);
 }
開發者ID:kchimbo,項目名稱:flyer,代碼行數:10,代碼來源:FlyersController.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\FlyerRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\FlyerRequest $request)
 {
     //
     // validate form
     //$this->validate();
     //USING FlyerRequest to Validate
     // persist flyer
     Flyer::create($request->all());
     //flash messaging
     flash('Success', 'Flyer successfully created!');
     // redirect to landing page or the flyer
     return redirect()->back();
 }
開發者ID:qtheninja,項目名稱:flyer,代碼行數:19,代碼來源:FlyersController.php

示例14: addPhoto

 /**
  * Apply a photo to the referenced flyer.
  * @param string  $zip  
  * @param string  $street  
  * @param Request $request 
  */
 public function addPhoto($zip, $street, Request $request)
 {
     $this->validate($request, ['photo' => 'required|mimes:jpg,jpeg,png,bmp']);
     $flyer = Flyer::locatedAt($zip, $street);
     if ($flyer->user_id !== \Auth::id()) {
         if ($request->ajax()) {
             return response(['message' => 'nowayjose'], 403);
         }
         flash('nowayjose');
         redirect('/');
     }
     $photo = $this->makePhoto($request->file('photo'));
     $flyer->addPhoto($photo);
 }
開發者ID:jay-nguyen,項目名稱:project-flyer,代碼行數:20,代碼來源:FlyersController.php

示例15: 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);
 }
開發者ID:garyobrien92,項目名稱:project-flyer,代碼行數:17,代碼來源:FlyersController.php


注:本文中的app\Flyer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。