本文整理汇总了PHP中app\Task::observe方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::observe方法的具体用法?PHP Task::observe怎么用?PHP Task::observe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Task
的用法示例。
在下文中一共展示了Task::observe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
\App\Project::observe(new \App\Observers\ActivityObserver());
\App\Task::observe(new \App\Observers\ActivityObserver());
\App\Activity::creating(function ($activity) {
$activity->user()->associate(auth()->user());
});
}
示例2: boot
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);
// register the ProjectObserver class.
Client::observe(new ClientObserver());
// register the ProjectObserver class.
Project::observe(new ProjectObserver());
// register the WorkTypeObserver class.
WorkType::observe(new WorkTypeObserver());
// register the TimeCardFormatObserver class.
TimeCardFormat::observe(new TimeCardFormatObserver());
// register the WorkObserver class.
Work::observe(new WorkObserver());
// register the TimeCardObserver class.
TimeCard::observe(new TimeCardObserver());
// register the TimeCardHoursWorkedObserver class.
TimeCardHoursWorked::observe(new TimeCardHoursWorkedObserver());
// register the TaskTypeObserver class.
TaskType::observe(new TaskTypeObserver());
// register the TaskObserver class.
Task::observe(new TaskObserver());
}