<?php

namespace App\Observers;
use Illuminate\Support\Facades\Auth;
use App\TutorialType;
use Illuminate\Database\Eloquent\SoftDeletes;

class TutorialTypeObserver
{
    use SoftDeletes;
    /**
     * Handle the tutorialType "created" event.
     *
     * @param  \App\TutorialType  $tutorialType
     * @return void
     */
    public function created(TutorialType $tutorialType)
    {
        //
    }

    /**
     * Handle the tutorialType "updated" event.
     *
     * @param  \App\TutorialType  $tutorialType
     * @return void
     */
    public function updated(TutorialType $tutorialType)
    {
        //
    }

    /**
     * Handle the tutorialType "deleted" event.
     *
     * @param  \App\TutorialType  $tutorialType
     * @return void
     */
    public function deleted(TutorialType $tutorialType)
    {
        $id = Auth::id();
        $tutorialType->deleted_by=$id;   
    }

    /**
     * Handle the tutorialType "restored" event.
     *
     * @param  \App\TutorialType  $tutorialType
     * @return void
     */
    public function restored(TutorialType $tutorialType)
    {
        //
    }

    /**
     * Handle the tutorialType "force deleted" event.
     *
     * @param  \App\TutorialType  $tutorialType
     * @return void
     */
    public function forceDeleted(TutorialType $tutorialType)
    {
        //
    }

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

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

    /**
     * Handle the TutorialType "deleting" event.
     *
     * @param  \App\TutorialType  $TutorialType
     * @return void
     */
    public function deleting(TutorialType $tutorialType)
    {
        $id = Auth::id();      
        $tutorialType->deleted_by=$id;   
    }
}
