feat: Add user level and experience attributes, and implement reward, task, and quest models with corresponding controllers and migrations
This commit is contained in:
parent
aa50740dcb
commit
fd20278948
17 changed files with 963 additions and 112 deletions
22
backend/app/Models/Reward.php
Normal file
22
backend/app/Models/Reward.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reward extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'unlocked_at_level'
|
||||
];
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'reward_user');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue