/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     Subject::saving(function ($subject) {
         $subject->pre_request = empty($subject->pre_request) ? null : $subject->pre_request;
     });
     Element::created(function ($element) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'element', 'reference_id' => $element->id]);
     });
     Element::updated(function ($element) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'element', 'reference_id' => $element->id]);
     });
     Element::deleted(function ($element) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'element', 'reference_id' => $element->id]);
     });
     Subject::created(function ($subject) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'subject', 'reference_id' => $subject->id]);
     });
     Subject::updated(function ($subject) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'subject', 'reference_id' => $subject->id]);
     });
     Subject::deleted(function ($subject) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'subject', 'reference_id' => $subject->id]);
     });
     Lesson::created(function ($lesson) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'lesson', 'reference_id' => $lesson->id]);
     });
     Lesson::updated(function ($lesson) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'lesson', 'reference_id' => $lesson->id]);
     });
     Lesson::deleted(function ($lesson) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'lesson', 'reference_id' => $lesson->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Faculty
     Faculty::created(function ($faculty) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_Faculty', 'reference_id' => $faculty->id]);
     });
     Faculty::updated(function ($faculty) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_Faculty', 'reference_id' => $faculty->id]);
     });
     Faculty::deleted(function ($faculty) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_Faculty', 'reference_id' => $faculty->id]);
     });
     //Year
     Year::created(function ($year) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_Year', 'reference_id' => $year->id]);
     });
     Year::updated(function ($year) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_Year', 'reference_id' => $year->id]);
     });
     Year::deleted(function ($year) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_Year', 'reference_id' => $year->id]);
     });
     //Term
     Term::created(function ($term) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_term', 'reference_id' => $term->id]);
     });
     Term::updated(function ($term) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_term', 'reference_id' => $term->id]);
     });
     Term::deleted(function ($term) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_term', 'reference_id' => $term->id]);
     });
     //Department
     Department::created(function ($department) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_department', 'reference_id' => $department->id]);
     });
     Department::updated(function ($department) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_department', 'reference_id' => $department->id]);
     });
     Department::deleted(function ($department) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_department', 'reference_id' => $department->id]);
     });
     //Specailty
     Specialty::created(function ($specialty) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_specialty', 'reference_id' => $specialty->id]);
     });
     Specialty::updated(function ($specialty) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_specialty', 'reference_id' => $specialty->id]);
     });
     Specialty::deleted(function ($specialty) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Academystructure_specialty', 'reference_id' => $specialty->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //ContactMessage
     ContactMessage::created(function ($message) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Contact_message', 'reference_id' => $message->id]);
     });
     ContactMessage::updated(function ($message) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Contact_message', 'reference_id' => $message->id]);
     });
     ContactMessage::deleted(function ($message) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Contact_message', 'reference_id' => $message->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //CallingLog
     CallingLog::created(function ($callingLog) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'CallingLog_callingLog', 'reference_id' => $callingLog->id]);
     });
     CallingLog::updated(function ($callingLog) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'CallingLog_callingLog', 'reference_id' => $callingLog->id]);
     });
     CallingLog::deleted(function ($callingLog) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'CallingLog_callingLog', 'reference_id' => $callingLog->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //SupportprogramsApplication
     SupportprogramsApplication::created(function ($supportprogram) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'SupportprogramsApplication_supportprogram', 'reference_id' => $supportprogram->id]);
     });
     SupportprogramsApplication::updated(function ($supportprogram) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'SupportprogramsApplication_supportprogram', 'reference_id' => $supportprogram->id]);
     });
     SupportprogramsApplication::deleted(function ($supportprogram) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'SupportprogramsApplication_supportprogram', 'reference_id' => $supportprogram->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //User
     User::created(function ($user) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Users_user', 'reference_id' => $user->id]);
     });
     User::updated(function ($user) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Users_user', 'reference_id' => $user->id]);
     });
     User::deleted(function ($user) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Users_user', 'reference_id' => $user->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Reminder
     Reminder::created(function ($reminder) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Reminder_reminder', 'reference_id' => $reminder->id]);
     });
     Reminder::updated(function ($reminder) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Reminder_reminder', 'reference_id' => $reminder->id]);
     });
     Reminder::deleted(function ($reminder) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Reminder_reminder', 'reference_id' => $reminder->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //
     //
     Question::created(function ($question) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'question', 'reference_id' => $question->id]);
     });
     Question::updated(function ($question) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'question', 'reference_id' => $question->id]);
     });
     Question::deleted(function ($question) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'question', 'reference_id' => $question->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Financial
     Financial::created(function ($fanancial) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_fanancial', 'reference_id' => $fanancial->id]);
     });
     Financial::updated(function ($fanancial) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_fanancial', 'reference_id' => $fanancial->id]);
     });
     Financial::deleted(function ($fanancial) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_fanancial', 'reference_id' => $fanancial->id]);
     });
     //FinancialInvoice
     FinancialInvoice::created(function ($invoice) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_invoice', 'reference_id' => $invoice->id]);
     });
     FinancialInvoice::updated(function ($invoice) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_invoice', 'reference_id' => $invoice->id]);
     });
     FinancialInvoice::deleted(function ($invoice) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_invoice', 'reference_id' => $invoice->id]);
     });
     //FinancialInvoiceItem
     FinancialInvoiceItem::created(function ($invoiceitem) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_invoiceitem', 'reference_id' => $invoiceitem->id]);
     });
     FinancialInvoiceItem::updated(function ($invoiceitem) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_invoiceitem', 'reference_id' => $invoiceitem->id]);
     });
     FinancialInvoiceItem::deleted(function ($invoiceitem) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_invoiceitem', 'reference_id' => $invoiceitem->id]);
     });
     //FinancialException
     FinancialException::created(function ($excuse) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_execptions', 'reference_id' => $excuse->id]);
     });
     FinancialException::updated(function ($excuse) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_execptions', 'reference_id' => $excuse->id]);
     });
     FinancialException::deleted(function ($excuse) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Financial_execptions', 'reference_id' => $excuse->id]);
     });
 }
Example #10
0
 public function register()
 {
     //Classroom
     Classroom::created(function ($classroom) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classrooms', 'reference_id' => $classroom->id]);
     });
     Classroom::updated(function ($classroom) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classrooms', 'reference_id' => $classroom->id]);
     });
     Classroom::deleted(function ($classroom) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classrooms', 'reference_id' => $classroom->id]);
     });
     //ClassroomInterval
     ClassroomInterval::created(function ($classroominterval) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_intervals', 'reference_id' => $classroominterval->id]);
     });
     ClassroomInterval::updated(function ($classroominterval) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_intervals', 'reference_id' => $classroominterval->id]);
     });
     ClassroomInterval::deleted(function ($classroominterval) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_intervals', 'reference_id' => $classroominterval->id]);
     });
     //ClassroomSessionExcuse
     ClassroomSessionExcuse::created(function ($classroomsessionexcuses) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_session_excuses', 'reference_id' => $classroomsessionexcuses->id]);
     });
     ClassroomSessionExcuse::updated(function ($classroomsessionexcuses) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_session_excuses', 'reference_id' => $classroomsessionexcuses->id]);
     });
     ClassroomSessionExcuse::deleted(function ($classroomsessionexcuses) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_session_excuses', 'reference_id' => $classroomsessionexcuses->id]);
     });
     //ClassroomSession
     ClassroomSession::created(function ($classroomsession) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_sessions', 'reference_id' => $classroomsession->id]);
     });
     ClassroomSession::updated(function ($classroomsession) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_sessions', 'reference_id' => $classroomsession->id]);
     });
     ClassroomSession::deleted(function ($classroomsession) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'classroom_sessions', 'reference_id' => $classroomsession->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Papersemesterdoc
     Papersemesterdoc::created(function ($papersemesterdoc) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_papersemesterdoc', 'reference_id' => $papersemesterdoc->id]);
     });
     Papersemesterdoc::updated(function ($papersemesterdoc) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_papersemesterdoc', 'reference_id' => $papersemesterdoc->id]);
     });
     Papersemesterdoc::deleted(function ($papersemesterdoc) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_papersemesterdoc', 'reference_id' => $papersemesterdoc->id]);
     });
     //PaperDoc
     PaperDoc::created(function ($paperdoc) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paperdoc', 'reference_id' => $paperdoc->id]);
     });
     PaperDoc::updated(function ($paperdoc) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paperdoc', 'reference_id' => $paperdoc->id]);
     });
     PaperDoc::deleted(function ($paperdoc) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paperdoc', 'reference_id' => $paperdoc->id]);
     });
     //PaperFile
     PaperFile::created(function ($paperfile) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paperfile', 'reference_id' => $paperfile->id]);
     });
     PaperFile::updated(function ($paperfile) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paperfile', 'reference_id' => $paperfile->id]);
     });
     PaperFile::deleted(function ($paperfile) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paperfile', 'reference_id' => $paperfile->id]);
     });
     //Paper
     Paper::created(function ($paper) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paper', 'reference_id' => $paper->id]);
     });
     Paper::updated(function ($paper) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paper', 'reference_id' => $paper->id]);
     });
     Paper::deleted(function ($paper) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Papers_paper', 'reference_id' => $paper->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     Year::created(function ($year) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'year', 'reference_id' => $year->id]);
     });
     Year::updated(function ($year) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'year', 'reference_id' => $year->id]);
     });
     Year::deleted(function ($year) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'year', 'reference_id' => $year->id]);
     });
     Semester::created(function ($semester) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semester', 'reference_id' => $semester->id]);
     });
     Semester::updated(function ($semester) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semester', 'reference_id' => $semester->id]);
     });
     Semester::deleted(function ($semester) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semester', 'reference_id' => $semester->id]);
     });
     SemesterEvent::created(function ($semesterEvent) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semesterEvent', 'reference_id' => $semesterEvent->id]);
     });
     SemesterEvent::updated(function ($semesterEvent) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semesterEvent', 'reference_id' => $semesterEvent->id]);
     });
     SemesterEvent::deleted(function ($semesterEvent) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semesterEvent', 'reference_id' => $semesterEvent->id]);
     });
     SemesterEventType::created(function ($semesterEventType) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semesterEventType', 'reference_id' => $semesterEventType->id]);
     });
     SemesterEventType::updated(function ($semesterEventType) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semesterEventType', 'reference_id' => $semesterEventType->id]);
     });
     SemesterEventType::deleted(function ($semesterEventType) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'semesterEventType', 'reference_id' => $semesterEventType->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //BlogCategory
     BlogCategory::created(function ($category) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Blog_category', 'reference_id' => $category->id]);
     });
     Blogcategory::updated(function ($category) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Blog_category', 'reference_id' => $category->id]);
     });
     Blogcategory::deleted(function ($category) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Blog_category', 'reference_id' => $category->id]);
     });
     //BlogPost
     BlogPost::created(function ($post) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Blog$post', 'reference_id' => $post->id]);
     });
     BlogPost::updated(function ($post) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Blog$post', 'reference_id' => $post->id]);
     });
     BlogPost::deleted(function ($post) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Blog$post', 'reference_id' => $post->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //LibraryBook
     LibraryBook::created(function ($book) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Library_book', 'reference_id' => $book->id]);
     });
     LibraryBook::updated(function ($book) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Library_book', 'reference_id' => $book->id]);
     });
     LibraryBook::deleted(function ($book) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Library_book', 'reference_id' => $book->id]);
     });
     //LibraryCategory
     LibraryCategory::created(function ($category) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Library_category', 'reference_id' => $category->id]);
     });
     LibraryCategory::updated(function ($category) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Library_category', 'reference_id' => $category->id]);
     });
     LibraryCategory::deleted(function ($category) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Library_category', 'reference_id' => $category->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Category
     Category::created(function ($category) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'FAQ_category', 'reference_id' => $category->id]);
     });
     Category::updated(function ($category) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'FAQ_category', 'reference_id' => $category->id]);
     });
     Category::deleted(function ($category) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'FAQ_category', 'reference_id' => $category->id]);
     });
     //QuestionsAnswers
     QuestionsAnswers::created(function ($questionsanswer) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'FAQ_questionsanswer', 'reference_id' => $questionsanswer->id]);
     });
     QuestionsAnswers::updated(function ($questionsanswer) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'FAQ_questionsanswer', 'reference_id' => $questionsanswer->id]);
     });
     QuestionsAnswers::deleted(function ($questionsanswer) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'FAQ_questionsanswer', 'reference_id' => $questionsanswer->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Announcement
     Announcement::created(function ($announcement) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcement', 'reference_id' => $announcement->id]);
     });
     Announcement::updated(function ($announcement) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcement', 'reference_id' => $announcement->id]);
     });
     Announcement::deleted(function ($announcement) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcement', 'reference_id' => $announcement->id]);
     });
     //Announcementclassroom
     Announcementclassroom::created(function ($announcementclassroom) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementclassroom', 'reference_id' => $announcementclassroom->id]);
     });
     Announcementclassroom::updated(function ($announcementclassroom) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementclassroom', 'reference_id' => $announcementclassroom->id]);
     });
     Announcementclassroom::deleted(function ($announcementclassroom) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementclassroom', 'reference_id' => $announcementclassroom->id]);
     });
     //AnnouncementFile
     AnnouncementFile::created(function ($announcementFile) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementFile', 'reference_id' => $announcementFile->id]);
     });
     AnnouncementFile::updated(function ($announcementFile) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementFile', 'reference_id' => $announcementFile->id]);
     });
     AnnouncementFile::deleted(function ($announcementFile) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementFile', 'reference_id' => $announcementFile->id]);
     });
     //Announcementspecialties
     Announcementspecialties::created(function ($announcementspecialties) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementspecialties', 'reference_id' => $announcementspecialties->id]);
     });
     Announcementspecialties::updated(function ($announcementspecialties) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementspecialties', 'reference_id' => $announcementspecialties->id]);
     });
     Announcementspecialties::deleted(function ($announcementspecialties) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementspecialties', 'reference_id' => $announcementspecialties->id]);
     });
     //Announcementstudent
     Announcementstudent::created(function ($announcementstudent) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementstudent', 'reference_id' => $announcementstudent->id]);
     });
     Announcementstudent::updated(function ($announcementstudent) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementstudent', 'reference_id' => $announcementstudent->id]);
     });
     Announcementstudent::deleted(function ($announcementstudent) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementstudent', 'reference_id' => $announcementstudent->id]);
     });
     //Announcementyear
     Announcementyear::created(function ($announcementyear) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementyear', 'reference_id' => $announcementyear->id]);
     });
     Announcementyear::updated(function ($announcementyear) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementyear', 'reference_id' => $announcementyear->id]);
     });
     Announcementyear::deleted(function ($announcementyear) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Announcements_announcementyear', 'reference_id' => $announcementyear->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Teacher
     Teacher::created(function ($teacher) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_teacher', 'reference_id' => $teacher->id]);
     });
     Teacher::updated(function ($teacher) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_teacher', 'reference_id' => $teacher->id]);
     });
     Teacher::deleted(function ($teacher) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_teacher', 'reference_id' => $teacher->id]);
     });
     //TeacherFund
     TeacherFund::created(function ($fund) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_fund', 'reference_id' => $fund->id]);
     });
     TeacherFund::updated(function ($fund) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_fund', 'reference_id' => $fund->id]);
     });
     TeacherFund::deleted(function ($fund) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_fund', 'reference_id' => $fund->id]);
     });
     //TeacherGuide
     TeacherGuide::created(function ($guide) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_guide', 'reference_id' => $guide->id]);
     });
     TeacherGuide::updated(function ($guide) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_guide', 'reference_id' => $guide->id]);
     });
     TeacherGuide::deleted(function ($guide) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_guide', 'reference_id' => $guide->id]);
     });
     //TeacherMessage
     TeacherMessage::created(function ($message) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_message', 'reference_id' => $message->id]);
     });
     TeacherMessage::updated(function ($message) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_message', 'reference_id' => $message->id]);
     });
     TeacherMessage::deleted(function ($message) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_message', 'reference_id' => $message->id]);
     });
     //TeacherMessageAttachment
     TeacherMessageAttachment::created(function ($messageattach) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_messageattach', 'reference_id' => $messageattach->id]);
     });
     TeacherMessageAttachment::updated(function ($messageattach) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_messageattach', 'reference_id' => $messageattach->id]);
     });
     TeacherMessageAttachment::deleted(function ($messageattach) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_messageattach', 'reference_id' => $messageattach->id]);
     });
     //TeacherSubject
     TeacherSubject::created(function ($subject) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_subject', 'reference_id' => $subject->id]);
     });
     TeacherSubject::updated(function ($subject) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_subject', 'reference_id' => $subject->id]);
     });
     TeacherSubject::deleted(function ($subject) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Teachers_subject', 'reference_id' => $subject->id]);
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //Exam
     Exam::created(function ($exam) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_exam', 'reference_id' => $exam->id]);
     });
     Exam::updated(function ($exam) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_exam', 'reference_id' => $exam->id]);
     });
     Exam::deleted(function ($exam) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_exam', 'reference_id' => $exam->id]);
     });
     //ExamCenter
     ExamCenter::created(function ($center) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_center', 'reference_id' => $center->id]);
     });
     ExamCenter::updated(function ($center) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_center', 'reference_id' => $center->id]);
     });
     ExamCenter::deleted(function ($center) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_center', 'reference_id' => $center->id]);
     });
     //ExamCenterPeriod
     ExamCenterPeriod::created(function ($period) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_period', 'reference_id' => $period->id]);
     });
     ExamCenterPeriod::updated(function ($period) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_period', 'reference_id' => $period->id]);
     });
     ExamCenterPeriod::deleted(function ($period) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_period', 'reference_id' => $period->id]);
     });
     //ExamQuestion
     ExamQuestion::created(function ($question) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_question', 'reference_id' => $question->id]);
     });
     ExamQuestion::updated(function ($question) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_question', 'reference_id' => $question->id]);
     });
     ExamQuestion::deleted(function ($question) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_question', 'reference_id' => $question->id]);
     });
     //ExamRecording
     ExamRecording::created(function ($recording) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_recording', 'reference_id' => $recording->id]);
     });
     ExamRecording::updated(function ($recording) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_recording', 'reference_id' => $recording->id]);
     });
     ExamRecording::deleted(function ($recording) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_recording', 'reference_id' => $recording->id]);
     });
     //ExamResult
     ExamResult::created(function ($result) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_result', 'reference_id' => $result->id]);
     });
     ExamResult::updated(function ($result) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_result', 'reference_id' => $result->id]);
     });
     ExamResult::deleted(function ($result) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_result', 'reference_id' => $result->id]);
     });
     //ExamResultAnswer
     ExamResultAnswer::created(function ($answer) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_answer', 'reference_id' => $answer->id]);
     });
     ExamResultAnswer::updated(function ($answer) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_answer', 'reference_id' => $answer->id]);
     });
     ExamResultAnswer::deleted(function ($answer) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_answer', 'reference_id' => $answer->id]);
     });
     //ExamRules
     ExamRules::created(function ($rule) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_rule', 'reference_id' => $rule->id]);
     });
     ExamRules::updated(function ($rule) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_rule', 'reference_id' => $rule->id]);
     });
     ExamRules::deleted(function ($rule) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_rule', 'reference_id' => $rule->id]);
     });
     //ExamExcuse
     ExamExcuse::created(function ($excuse) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_excuses', 'reference_id' => $excuse->id]);
     });
     ExamExcuse::updated(function ($excuse) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_excuses', 'reference_id' => $excuse->id]);
     });
     ExamExcuse::deleted(function ($excuse) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Exams_excuses', 'reference_id' => $excuse->id]);
     });
 }