first commit

This commit is contained in:
2025-04-09 23:03:16 +03:00
commit 909d514552
129 changed files with 17249 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Artwork extends Model
{
use HasFactory;
protected $fillable = [
'igdb_id',
'game_id',
'url',
'width',
'height',
'image_id',
];
public function game(): BelongsTo
{
return $this->belongsTo(Game::class);
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Game extends Model
{
use HasFactory;
protected $fillable = [
'igdb_id',
'name',
'summary',
'storyline',
'cover_url',
'slug',
'first_release_date',
'rating',
'rating_count',
'category',
'status',
'url',
'version_title',
];
protected $casts = [
'first_release_date' => 'date',
'rating' => 'float',
'rating_count' => 'integer',
];
public function genres(): BelongsToMany
{
return $this->belongsToMany(Genre::class);
}
public function platforms(): BelongsToMany
{
return $this->belongsToMany(Platform::class);
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Genre extends Model
{
use HasFactory;
protected $fillable = [
'igdb_id',
'name',
'slug',
];
public function games(): BelongsToMany
{
return $this->belongsToMany(Game::class);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Platform extends Model
{
use HasFactory;
protected $fillable = [
'igdb_id',
'name',
'slug',
'abbreviation',
];
public function games(): BelongsToMany
{
return $this->belongsToMany(Game::class);
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Screenshot extends Model
{
use HasFactory;
protected $fillable = [
'igdb_id',
'game_id',
'url',
'width',
'height',
'image_id',
];
public function game(): BelongsTo
{
return $this->belongsTo(Game::class);
}
}
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Video extends Model
{
use HasFactory;
protected $fillable = [
'igdb_id',
'game_id',
'name',
'video_id',
'url',
'checksum',
];
public function game(): BelongsTo
{
return $this->belongsTo(Game::class);
}
}