You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
764 B

<?php
namespace App\Models;
use App\Models\Model;
class Fingerprint extends Model
{
protected $fillable = ['user_id', 'agent', 'ip', 'os', 'latitude', 'longitude', 'token', 'fcm_token'];
protected $table = 'fingerprints';
public function user()
{
return $this->belongsTo(User::class, 'user_id', 'id', __FUNCTION__);
}
public function rules()
{
return [
'user_id' => 'required|integer|exists:users,id',
'agent' => 'required|string',
'ip' => 'required|ip',
'os' => 'required|string',
'latitude' => 'required',
'longitude' => 'required',
'token' => 'required|string|min:60',
'fcm_token' => 'nullable',
];
}
}