static function boot() { parent::boot(); Static::observe(new DestinationObserver()); Static::observe(new HasNameObserver()); Static::observe(new TreeObserver()); }
static function boot() { parent::boot(); Static::observe(new HeadlineObserver()); Static::observe(new HasManyImagesObserver()); Static::observe(new BelongsToTravelAgentObserver()); }
static function boot() { parent::boot(); Static::saving(function ($model) { $model->is_admin = 1; }); }
function setNameAttribute($v) { $this->attributes[Static::$name_field] = $v; if ($this->attributes['slug']) { $this->attributes['slug'] = Static::generateSlug($v, $this->_id); } }
static function boot() { parent::boot(); Static::observe(new PackageObserver()); Static::observe(new HasNameObserver()); Static::observe(new HasSlugObserver()); }
/** * @return Facade */ protected static function getFacadeRoot() { static $instance = null; if (!$instance) { $instance = Container::GetInstance(Static::getFacadeAccessor()); } return $instance; }
public static function ByPriorityTravelAgent($limit = 10) { return Static::join('travel_agencies', 'travel_agencies.id', '=', 'tours.travel_agent_id')->join('package_travel_agent', 'package_travel_agent.travel_agent_id', '=', 'travel_agencies.id')->join('packages', function ($join) { $join->on('packages.id', '=', 'package_travel_agent.package_id')->where('active_since', '<=', \Carbon\Carbon::now())->where('active_until', '>=', \Carbon\Carbon::now()); })->whereHas('schedules', function ($q) { $q->where('departure', '>=', \Carbon\Carbon::now()); })->select('tours.*')->orderBy('packages.priority', 'desc')->limit($limit)->get(); }
static function boot() { parent::boot(); Static::observe(new PlaceObserver()); Static::observe(new HasNameObserver()); Static::observe(new HasSlugObserver()); Static::observe(new HasPublishedAtObserver()); }
function scopeSlugIs($q, $v) { if (!$v) { return $q; } else { return $q->where(Static::getSlugField(), 'like', $v); } }
public static function get($key = NULL, $default = NULL, $xss = true) { if ($xss) { return Static::get($key, $default); } else { return Static::get($key, $default); } }
public function scopeNameLike($q, $v = null) { if (!$v) { return $q; } else { $v = str_replace('*', '%', $v); return $q->where(Static::getNameField(), 'like', $v); } }
public function isBarcodeAmongAllProducts() { //if( strtolower($this->barcodeid) === 'empty'){ return true; } if (strtolower($this->barcodeid) === 'empty') { $this->barcodeid = ''; return true; } $prd = Static::where('barcodeid', $this->barcodeid)->first(); //dd($prd); return $prd === null ? true : false; }
static function bootPublishableTrait() { if (!isset(Static::$slug_field)) { throw new Exception("\$slug_field has not been set", 1); } if (!isset(Static::$slug_source_field)) { throw new Exception("\$slug_source_field has not been set", 1); } Static::saving(function ($model) { if (!$model->{$model->slug_field}) { $model->{$model->slug_field} = str_slug($model->{$model->slug_source_field}); } }); }
public static function textColorFor($color_string) { $color = Static::colorHexToDec($color_string); $black = [0, 0, 0]; $white = [256, 256, 256]; $blackTextPoints = 0; $whiteTextPoints = 0; Static::colorDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints; Static::colorDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints; Static::brightDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints; Static::brightDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints; Static::lumDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints; Static::lumDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints; Static::pythDiff($color, $black) == 'true' ? ++$blackTextPoints : --$blackTextPoints; Static::pythDiff($color, $white) == 'true' ? ++$whiteTextPoints : --$whiteTextPoints; return $blackTextPoints > $whiteTextPoints ? "black" : "white"; }
static function boot() { parent::boot(); Static::observe(new IssuedVoucherObserver()); }
function getPathSlugAttribute() { return str_replace(Static::getDelimiter(), ',', $this->path); }
/** * @return FacadeService */ protected static function getFacadeRoot() { return Container::Instance()->GetInstance(Static::getFacadeAccessor()); }
static function boot() { parent::boot(); Static::observe(new ContentObserver()); }
static function boot() { parent::boot(); Static::observe(new TravelAgentObserver()); Static::observe(new HasNameObserver()); }
static function GetDestinationTags() { Static::init(); $query_data['type'] = 'destination'; $query_data['group'] = true; $api_response = Cache::remember('destination_tag_' . http_build_query($query_data), 20, function () use($query_data) { return json_decode(self::$api->get(self::$api_url . '/tags?' . http_build_query(array_merge($query_data, ['access_token' => Session::get('access_token')])))->getBody(), false); }); if ($api_response->status != 'success') { return null; } return $api_response->data->data; }
private static function setMenu() { Static::$arrMainMenu = [['url' => 'dashboard', 'label' => 'Dashboard', 'rawContent' => '<i class="fa fa-dashboard"></i> <span>Dashboard</span>'], ['url' => 'contacts', 'label' => 'Contact', 'rawContent' => '<i class="fa fa-dashboard"></i> <span>Contact</span> <small class="badge pull-right bg-yellow">12</small>'], ['url' => '#', 'label' => 'Parent', 'rawContent' => '<i class="fa fa-calendar"></i> <span>Parent</span> <i class="fa fa-angle-left pull-right"></i>', 'childrens' => [['url' => '#', 'label' => 'Menu 1', 'rawContent' => '<i class="fa fa-angle-double-right"></i>Menu 1'], ['url' => '#', 'label' => 'Menu 2', 'rawContent' => '<i class="fa fa-angle-double-right"></i>Menu 2'], ['url' => '#', 'label' => 'Menu 3', 'rawContent' => '<i class="fa fa-angle-double-right"></i>Menu 3']]], ['url' => 'inbox', 'label' => 'Inbox', 'rawContent' => '<i class="fa fa-envelope"></i> <span>Inbox</span>']]; }
static function boot() { parent::boot(); Static::observe(new SubscriberObserver()); }
public function download() { $plan = new Static(); return $plan->fill(['path' => storage_path() . '/' . $this->path, 'name' => $this->filename]); }
function bootBelongsToDestinationTrait() { Static::observe(new BelongsToDestinationObserver()); }
static function bootHasImages() { Static::observe(new HasImagesObserver()); }
static function boot() { parent::boot(); Static::observe(new AddressObserver()); }
function setTitleAttribute($v) { $this->attributes[Static::$name_field] = $v; $this->attributes['slug'] = Static::generateSlug($v, $this->id); }
static function boot() { parent::boot(); Static::observe(new ImageObserver()); }
function bootBelongsToManyPlacesTrait() { Static::observe(new BelongsToManyPlacesObserver()); }
function bootBelongsToTourTrait() { Static::observe(new BelongsToTourObserver()); }