| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace plunner; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use Illuminate\Database\Eloquent\Model; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * plunner\Group | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  * @property integer $id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  * @property \Carbon\Carbon $created_at | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  * @property \Carbon\Carbon $updated_at | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  * @property string $name | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  * @property string $description | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  * @property integer $planner_id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  * @property-read \Illuminate\Database\Eloquent\Collection|\plunner\Employee[] $employees | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereId($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereCreatedAt($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereUpdatedAt($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereName($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereDescription($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group wherePlannerId($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  * @property integer $company_id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |  * @method static \Illuminate\Database\Query\Builder|\plunner\Group whereCompanyId($value) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | class Group extends Model | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |      * The database table used by the model. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |      * @var string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |     protected $table = 'groups'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |      * The attributes that are mass assignable. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     protected $fillable = ['name', 'description', 'planner_id']; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  | //    protected $hidden = ['planner']; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |      * @var array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |     protected $appends = ['planner_name']; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 | 14 |  |     public function getPlannerNameAttribute() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 | 14 |  |         if(is_object($this->planner) && $this->planner->exists) | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 | 14 |  |             return $this->planner->name; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 | 1 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |      * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |     public function employees() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |         return $this->belongsToMany(Employee::class); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 | 14 |  |     public function planner() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 | 14 |  |         return $this->belongsTo(Planner::class); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 70 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 71 |  |  |     public function company() | 
            
                                                        
            
                                    
            
            
                | 72 |  |  |     { | 
            
                                                        
            
                                    
            
            
                | 73 |  |  |         return $this->belongsTo(Company::class); | 
            
                                                        
            
                                    
            
            
                | 74 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 75 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 76 |  |  |  | 
            
                        
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.