<?php

namespace App\Observers;

use Illuminate\Support\Facades\Auth;
use App\TeacherSubjectAllocation;

class TeacherSubjectAllocationObserver
{
    /**
     * Handle the batch wise subject "created" event.
     *
     * @param  \App\TeacherSubjectAllocation  $teachersubjectallocation
     * @return void
     */
    public function created(TeacherSubjectAllocation $teachersubjectallocation)
    {
        //
    }

    /**
     * Handle the batch wise subject "updated" event.
     *
     * @param  \App\TeacherSubjectAllocation  $teachersubjectallocation
     * @return void
     */
    public function updated(TeacherSubjectAllocation $teachersubjectallocation)
    {
        //
    }

    /**
     * Handle the batch wise subject "deleted" event.
     *
     * @param  \App\TeacherSubjectAllocation  $teachersubjectallocation
     * @return void
     */
    public function deleted(TeacherSubjectAllocation $teachersubjectallocation)
    {
        //
    }

    /**
     * Handle the batch wise subject "restored" event.
     *
     * @param  \App\TeacherSubjectAllocation  $teachersubjectallocation
     * @return void
     */
    public function restored(TeacherSubjectAllocation $teachersubjectallocation)
    {
        //
    }

    /**
     * Handle the batch wise subject "force deleted" event.
     *
     * @param  \App\TeacherSubjectAllocation  $teachersubjectallocation
     * @return void
     */
    public function forceDeleted(TeacherSubjectAllocation $teachersubjectallocation)
    {
        //
    }

    
    /**
     * Handle the TeacherSubjectAllocation "creating" event.
     *
     * @param  \App\TeacherSubjectAllocation  $TeacherSubjectAllocation
     * @return void
     */
    public function creating(TeacherSubjectAllocation $TeacherSubjectAllocation)
    {
        $id = Auth::id();
        $TeacherSubjectAllocation->created_by=$id;
        $TeacherSubjectAllocation->updated_by=$id;   
    }

    /**
     * Handle the TeacherSubjectAllocation "updating" event.
     *
     * @param  \App\TeacherSubjectAllocation  $TeacherSubjectAllocation
     * @return void
     */
    public function updating(TeacherSubjectAllocation $TeacherSubjectAllocation)
    {
      
        $id = Auth::id();
        $TeacherSubjectAllocation->updated_by=$id;   
    }
}
