Ejemplo n.º 1
0
 /**
  * Called after the creation or updating form is saved.
  * @param Model
  */
 public function formAfterSave($model)
 {
     if ($model->calendar) {
         $calendar = Calendar::find($model->calendar->id);
         $calendar->name = $model->name;
         $calendar->slug = $model->slug;
         $calendar->save();
     } else {
         $calendar = new Calendar(['name' => $model->name, 'slug' => $model->slug]);
         $model->calendar()->save($calendar);
     }
 }
Ejemplo n.º 2
0
 public function boot()
 {
     Calendar::extend(function ($model) {
         $model->belongsTo['ministry'] = ['Sitesforchurch\\Ministries\\Models\\Ministry'];
     });
 }