Example #1
0
 /**
  * Load the data.
  */
 private function loadData()
 {
     foreach ($this->store->all() as $setting) {
         /** @var  \Arcanesoft\Settings\Models\Setting  $setting */
         $data = $this->data->get($setting->domain, []);
         Arr::set($data, $setting->key, $setting->casted_value);
         $this->data->put($setting->domain, $data);
     }
 }
Example #2
0
 public function byType($type, $id)
 {
     if (!($cladire = Build::find($id))) {
         return $this->try_($cladire);
     }
     $cladirea = Build::with('counters.bills')->where('id', $id)->first();
     $out = new Collection();
     foreach ($cladirea['counters'] as $k => $contor) {
         foreach ($contor['bills'] as $i => $factura) {
             if ($factura['type_bill'] == $type) {
                 $out->push($factura);
             }
         }
     }
     /* out -> toate facturile pe tipul respectiv */
     $out = $this->sortDateAsc($out);
     $this->out_months = $this->consum_lunar($out);
     $all = $this->out_months;
     $t = array_values($all);
     $first = array_shift($t);
     $data = $first['months'];
     $header = '';
     $content = '';
     $i = 0;
     foreach ($all as $k => $al) {
         $class = $i == 0 ? 'active' : '';
         $i++;
         $header .= view('consum.lunar.tabs.title')->with(['id' => $k, 'class' => $class])->render();
         $content .= view('consum.lunar.tabs.model')->with(['id' => $k, 'data' => $al, 'class' => $class])->render();
     }
     $tabs = view('consum.lunar.tabs.index')->with(['header' => $header, 'content' => $content])->render();
     if (count($all) == 0) {
         return redirect()->back()->withFlashWarning('Nu sunt date suficinte pentru acest tip de raport');
     }
     return $view = view('consum.lunar.index')->with(compact('data', 'chart', 'data', 'tabs', 'all'));
 }
Example #3
0
 /**
  * Get a module by key
  *
  * @param  string  $key
  * @param  mixed   $default
  *
  * @return Module
  */
 public function get($key, $default = null)
 {
     $key = str_slug($key);
     return parent::get($key, $default);
 }
Example #4
0
 /**
  * Get a log.
  *
  * @param  string      $date
  * @param  mixed|null  $default
  *
  * @return \Arcanedev\LogViewer\Entities\Log
  *
  * @throws \Arcanedev\LogViewer\Exceptions\LogNotFoundException
  */
 public function get($date, $default = null)
 {
     if (!$this->has($date)) {
         throw new LogNotFoundException("Log not found in this date [{$date}]");
     }
     return parent::get($date, $default);
 }
Example #5
0
 /**
  * Get a log.
  *
  * @param  string     $date
  * @param  mixed|null $default
  *
  * @return Log
  *
  * @throws LogNotFound
  */
 public function get($date, $default = null)
 {
     if (!$this->has($date)) {
         throw new LogNotFound('Log not found in this date [' . $date . ']');
     }
     return parent::get($date, $default);
 }
Example #6
0
 /**
  * Make MenuAttributes instance.
  *
  * @param  array  $items
  */
 public function __construct(array $items = [])
 {
     $items = $this->filterProperties($items);
     parent::__construct($items);
 }
 /**
  * Get an item from the collection by key.
  *
  * @param  string  $key
  * @param  mixed   $default
  *
  * @return \Arcanedev\LaravelLang\Entities\Locale|mixed
  */
 public function get($key, $default = null)
 {
     return parent::get($key, $default);
 }
Example #8
0
 /**
  * Get the last item from the collection.
  *
  * @param  callable|null  $callback
  * @param  mixed          $default
  *
  * @return \Arcanedev\Menus\Entities\MenuItem|mixed
  */
 public function last(callable $callback = null, $default = null)
 {
     return parent::last($callback, $default);
 }
Example #9
0
 /**
  * Set a specific key & value.
  *
  * @param  string  $key
  * @param  mixed   $value
  *
  * @return self
  */
 public function set($key, $value)
 {
     $this->attributes->offsetSet($key, $value);
     return $this;
 }
Example #10
0
 /**
  * Check if the entry is updated.
  *
  * @param  string  $domain
  * @param  string  $key
  * @param  mixed   $value
  *
  * @return bool
  */
 private function isUpdated($domain, $key, $value)
 {
     return array_get($this->saved->get($domain, []), $key) !== $value;
 }