AuthGoogle - Change model user, add model provider

This commit is contained in:
cgonzalesmo 2022-08-17 19:17:24 -05:00
parent 8b7214a1c7
commit 2f58ce32ec
2 changed files with 28 additions and 0 deletions

25
app/Models/Provider.php Normal file
View File

@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Provider extends Model
{
use HasFactory;
protected $fillable = [
'provider',
'id_provider',
'avatar'
];
protected $hidden = [
'created_at',
'updated_at'
];
public function users(){
return $this->belongsTo(User::class,'id_user');
}
}

View File

@ -33,4 +33,7 @@ public function plans(){
public function evidencias(){ public function evidencias(){
return $this->hasMany(Evidencia::class,'id'); return $this->hasMany(Evidencia::class,'id');
} }
public function providers(){
return $this->hasMany(Provider::class,'id_user');
}
} }