Esempio n. 1
0
 /**
  * Boot the model
  */
 public static function boot()
 {
     TagTranslation::saving(function ($translation) {
         if (empty($translation->getTagName()) || is_null($translation->getTagName())) {
             $translation->setSlugFromTitle();
         }
     });
 }
Esempio n. 2
0
 /**
  * @param Request $request
  * @param TagTranslation $translation
  */
 protected function validateEditForm(Request $request, TagTranslation $translation)
 {
     $this->validateForm('Reactor\\Html\\Forms\\Tags\\CreateEditForm', $request, ['title' => ['required', 'max:255', 'unique:tag_translations,title,' . $translation->getKey()], 'tag_name' => ['max:255', 'alpha_dash', 'unique:tag_translations,tag_name,' . $translation->getKey()]]);
 }