Exemplo n.º 1
0
 static function apply($query)
 {
     // check for package type
     //
     $type = Input::get('type');
     if ($type != '') {
         $packageType = PackageType::where('name', '=', $type)->first();
         if ($packageType) {
             $query = $query->where('package_type_id', '=', $packageType->package_type_id);
         }
     }
     return $query;
 }
Exemplo n.º 2
0
 public function getPackageTypeAttribute()
 {
     // get package type name
     //
     if ($this->package_type_id != null) {
         $packageType = PackageType::where('package_type_id', '=', $this->package_type_id)->first();
         if ($packageType) {
             return $packageType->name;
         }
     }
 }
Exemplo n.º 3
0
 /**
  * accessor methods
  */
 public function getPackageTypeNameAttribute()
 {
     $packageType = PackageType::where('package_type_id', '=', $this->package_type_id)->first();
     return $packageType->name;
 }