Add the event listener for the awards #155
This commit is contained in:
24
app/Awards/Pilot100Flights.php
Normal file
24
app/Awards/Pilot100Flights.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Awards;
|
||||
|
||||
use App\Interfaces\AwardInterface;
|
||||
|
||||
/**
|
||||
* Simple example of an awards class, where you can apply an award when a user
|
||||
* has 100 flights. All award classes need to implement the AwardInterface
|
||||
* @package App\Awards
|
||||
*/
|
||||
class Pilot100Flights extends AwardInterface
|
||||
{
|
||||
public $name = 'Pilot 100 Flights';
|
||||
|
||||
/**
|
||||
* If the user has over 100 flights, then we can give them this award
|
||||
* @return bool
|
||||
*/
|
||||
public function check(): bool
|
||||
{
|
||||
return $this->user->flights >= 100;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user