Beispiel #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     //
     $this->validate($request, $this->region->getValidationRules());
     $this->region->create($request->all())->save();
     return redirect()->route('admin.region.index')->with('messages', array('Рездел успешно добавлен'));
 }
 /**
  * Set new customer group to all his quotes
  *
  * @param Observer $observer
  * @return void
  */
 public function dispatch(Observer $observer)
 {
     $eventCode = $this->_getWebhookEvent();
     $eventData = $this->_getWebhookData($observer);
     $body = ['event' => $eventCode, 'data' => $eventData];
     $webhooks = $this->_webhookFactory->create()->getCollection()->addFieldToFilter('event', $eventCode);
     foreach ($webhooks as $webhook) {
         $this->_sendWebhook($webhook->getUrl(), $body);
     }
 }
Beispiel #3
0
 /**
  * dave image file
  * @param  [type] $path    [description]
  * @param  [type] $quality [description]
  * @return [type]          [description]
  */
 public function save($path = null, $quality = null)
 {
     if ($this->isAnimatedGif) {
         $framesProcessed = array();
         foreach ($this->frames as $frame) {
             $framesProcessed[] = $frame['image'];
         }
         $this->gifCreator->create($framesProcessed, $this->gifFrameExtractor->getFrameDurations(), 0);
         $gifBinary = $this->gifCreator->getGif();
         $this->gifCreator->reset();
         file_put_contents($path, $gifBinary);
     } else {
         $this->imgFileRes->save($path, $quality);
     }
     return $this;
 }