# fluent-booking/1.5.24/app/Models/Staff.php

Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution, version 1.5.24. 25 lines.

- Page: https://pluginprobe.com/plugins/fluent-booking/1.5.24/code/app/Models/Staff.php
- Raw: https://pluginprobe.com/plugins/fluent-booking/1.5.24/raw/app/Models/Staff.php
- Modified: 2024-07-16T14:25:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-booking/1.5.24/code/app/Models/Staff.php#L10-L20`.

```php
<?php

namespace FluentBooking\App\Models;
class Staff extends Meta
{
    public static function boot()
    {
        parent::boot();

        static::addGlobalScope('staff', function ($builder) {
            $builder->where('object_type', 'staff');
        });

        static::creating(function ($model) {
            $model->object_type = 'staff';
        });
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'object_id');
    }

}

```
