Added database recording

This commit is contained in:
2023-03-03 10:29:39 +11:00
parent a389264ec4
commit 32a75cb140
5 changed files with 101 additions and 41 deletions

17
app/Models/Site.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Site extends Model
{
protected $fillable = ['ip_address'];
/* RELATIONS */
public function versions()
{
return $this->hasMany(SiteVersion::class);
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SiteVersion extends Model
{
/* RELATIONS */
public function sites()
{
return $this->belongsTo(Site::class);
}
}

View File

@@ -1,33 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Lumen\Auth\Authorizable;
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, HasFactory;
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
'name', 'email',
];
/**
* The attributes excluded from the model's JSON form.
*
* @var string[]
*/
protected $hidden = [
'password',
];
}