remove compose file to another repo
This commit is contained in:
29
app/Models/User.php
Normal file
29
app/Models/User.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use App\Facades\File\FileFacade;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasFactory, Notifiable, HasRoles;
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = ['password'];
|
||||
public string $guard_name = 'web';
|
||||
|
||||
public function storeFile($file, $name)
|
||||
{
|
||||
if ($this->avatar) {
|
||||
FileFacade::delete($this->avatar, true);
|
||||
}
|
||||
|
||||
return FileFacade::save($file, 'users/avatars/' . $name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user