123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class Profile extends Model
- {
- protected $guarded = [];
-
- public function profileImage()
- {
- $imagePath = ($this->image) ? $this->image : 'profile/57O4X5QgQJLM5zXBiMpwprcdprSeCVdw14DxW7kL.png';
- return '/storage/' . $imagePath;
- }
- public function followers()
- {
- return $this->belongsToMany(User::class);
- }
- public function user()
- {
- return $this->belongsTo(User::class);
- }
- }
|