Skip to content

Commit

Permalink
T11 Create ProjectObserver.php
Browse files Browse the repository at this point in the history
  • Loading branch information
imtyaz-17 authored Jul 4, 2024
1 parent 27f4adc commit 997d452
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions app/Observers/ProjectObserver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace App\Observers;

use App\Models\Project;
use App\Models\Stat;

class ProjectObserver
{
/**
* Handle the Project "created" event.
*/
public function created(Project $project): void
{
//
Stat::first()->increment('projects_count');
}

/**
* Handle the Project "updated" event.
*/
public function updated(Project $project): void
{
//
}

/**
* Handle the Project "deleted" event.
*/
public function deleted(Project $project): void
{
//
}

/**
* Handle the Project "restored" event.
*/
public function restored(Project $project): void
{
//
}

/**
* Handle the Project "force deleted" event.
*/
public function forceDeleted(Project $project): void
{
//
}
}

0 comments on commit 997d452

Please sign in to comment.