Notify the mentioned model.

@param \Illuminate\Database\Eloquent\Model $model

@return \Xetaio\Mentions\Models\Mention
491704
public function notify(Model $model, Model $recipient): Mention
    {
        $pool = $this->pool($recipient);

        $notificationClass = class_exists($pool->notification) ? $pool->notification : $this->mentionNotification;

        if (class_exists($notificationClass)) {
            $recipient->notify(new $notificationClass($model));
        }

        return $this;
    }
750989
public function remove($model)
    {
        $class    = $this->manager->getClassMetadata(get_class($model));
        $managers = $class->getFieldManagerNames();
        $priority = $this->manager->getPool()->getPriority('transaction');

        foreach ($managers as $key => $managerName) {
            if (isset($priority[$managerName])) {
                $this->manager->remove($model);

                unset($managers[$key]); // dereference index
            }
        }

        foreach ($managers as $managerName) {
            $this->addQueue(self::QUEUE_ACTION_REMOVE, $managerName, $model);
        }
    }
1327210
public function setModel(Model $model)
    {
        if (($content = $this->getContent()) instanceof WithModelInterface) {
            $content->setModel($model);
        }

        return $this;
    }
1024470
public function push(AbstractModel $model)
    {
        $this->validateAdd($model);
        if (true === $this->willAdd($model)) {
            return $this;
        }
        if (true === $this->willRemove($model)) {
            $this->evict('removed', $model);
            $this->set('models', $model);
            return $this;
        }
        if (true === $this->hasOriginal($model)) {
            return $this;
        }
        $this->set('added', $model);
        $this->set('models', $model);
        return $this;
    }
1325904
public function updating(Eloquent $model)
    {
        $originalName = $model->getOriginal('name');
        $currentName  = $model->getAttribute('name');
        $deletedAt    = null;

        if ($model->isSoftDeleting()) {
            $deletedAt = $model->getDeletedAtColumn();
        }

        $isRestoring = function ($model, $deletedAt) {
            return (! is_null($deletedAt)
                && is_null($model->getAttribute($deletedAt))
                && ! is_null($model->getOriginal($deletedAt)));
        };

        if ($isRestoring($model, $deletedAt)) {
            $this->acl->addRole($currentName);
        } else {
            $this->acl->renameRole($originalName, $currentName);
        }
    }
276217
public function onCustomFieldCreateOrEdit(Model $model)
    {
        $this->onList();
        Breadcrumbs::register('customfields-create-update', function($breadcrumbs) use($model) {
            $breadcrumbs->parent('customfields');
            $name = $model->exists ? 'Update custom field ' . $model->name : 'Create custom field';
            $breadcrumbs->push($name, '#');
        });

        view()->share('breadcrumbs', Breadcrumbs::render('customfields-create-update'));
    }
112484
protected function showModifier(Model $model)
    {
        $name = $this->manager->getClassName($model);

        $this->title("Modifier of Model {$name}: ");

        $modifiers = [
            'mutators' => $this->manager->getMutators($model),
            'accessors' => $this->manager->getAccessors($model),
            'scopes' => $this->manager->getScopes($model),
        ];

         $rows = [];

        foreach (max($modifiers) as $modifier) {
            foreach (['mutator', 'accessor', 'scope'] as $type) {
                $$type = '';
                $types = &$modifiers[Str::plural($type)];

                if ($types->count() > 0) {
                    $$type = $this->paintString($types->first()->getName(), 'brown');
                    unset($types[0]);
                }
            }

            $rows[] = [$mutator, $accessor, $scope];
        }

        $headers = ['mutator', 'accessor', 'scope'];

        $this->table($headers, $rows);
        
    }
1282351
public function setModel($model)
    {
        if ($model instanceof Model) {
            $this->model = $model;
        } else {
            $this->model = Yii::createObject($model);
        }

        $model = $this->model;
        $this->updateFormName();

        if (empty($this->getScenario())) {
            $this->setScenario($model->scenario);
        }

        return $this->model;
    }
715152
public function setModel(\Illuminate\Database\Eloquent\Model $model) {
        $this->model = $model;
        if ($this->model instanceof ResourceInterface) {
            $this->enableAutoEagerLoading = true;
        }
    }
959569
protected function getReferenceFallback(Model $model)
    {
        // Use reference method if the model has one
        if (method_exists($model, 'getReferenceAttribute')) {
            return $model->reference;
        }

        if (method_exists($model, 'getReference')) {
            return $model->getReference();
        }

        return (string) $model->getKey();
    }
175874
public function updated(Option $model)
    {
        $option  = Option::query()->firstOrNew([
            'name' => 'notifications_remove_after_days'
        ]);

        $option->value = input('days');
        return $option->save();
    }
589661
public function onPreviewHtmlReport(Model $model)
    {
        $this->onReportsHistory();
        Breadcrumbs::register('logger-reports-preview-' . $model->id, function($breadcrumbs) use($model) {
            $breadcrumbs->parent('logger-reports-history');
            $breadcrumbs->push('Preview report ' . $model->name, handles('antares::logger/view/' . $model->id));
        });
        view()->share('breadcrumbs', Breadcrumbs::render('logger-reports-preview-' . $model->id));
    }
719215
protected function getModelInstanceQuery(Model $model)
    {
        $query = $model->query();

        $this->applyOrderingToModelInstanceQuery($query);
        $this->applyStartAndStopLimitsToQuery($query);

        return $query;
    }
945173
public function update(Model $model) {

		return $this->_populate(
			$this->_request('put', $this->_getUrl('element', $model->getPrimaryKey()), [
				'json' => $model->getAttributes()
			]),
			false
		);
	}
845824
public function associate($model)
    {
        $this->parent->setAttribute(
            $this->foreignKey, $model instanceof Model ? $model->getKey() : null
        );

        $this->parent->setAttribute(
            $this->morphType, $model instanceof Model ? $model->getMorphClass() : null
        );

        return $this->parent->setRelation($this->relationName, $model);
    }
1052751
public function persist($model)
    {
        $class    = $this->manager->getClassMetadata(get_class($model));
        $managers = $class->getFieldManagerNames();
        $pool     = $this->manager->getPool();
        $priority = $pool->getPriority('transaction');

        $id = null;

        if ($class->hasManagerReferenceGenerator()) {
            $managerName = $class->getManagerReferenceGenerator();
            $referenceModel = $model->{'get' . ucfirst($managerName)}();

            $pool->getManager($managerName)->persist($referenceModel);
            $id = $referenceModel->getId();

            unset($managers[$managerName]);
        }

        foreach ($managers as $key => $managerName) {
            if (isset($priority[$managerName])) {
                $this->doPersist($managerName, $model, $id);

                unset($managers[$key]); // dereference index
            }
        }

        foreach ($managers as $managerName) {
            $this->addQueue(self::QUEUE_ACTION_PERSIST, $managerName, $model, $id);
        }
    }
828375
public function link(Model $model)
    {
        if ( ! $this->routePrefix || ! $this->isPermitted) {
            return false;
        }

        return route($this->routePrefix . static::ROUTE_POSTFIX, [ $model->getKey() ]);
    }