mivita/app/Models/Customer.php
2025-10-20 17:42:08 +02:00

73 lines
2.9 KiB
PHP

<?php
namespace App\Models;
use App\User;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; // Wichtig!
/**
* @property int $id
* @property string|null $name
* @property string $email
* @property int|null $shopping_user_id
* @property int|null $member_id
* @property int|null $number
* @property string|null $language
* @property string|null $mode
* @property string|null $remember_token
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read User|null $member
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
* @property-read int|null $notifications_count
* @property-read \App\Models\ShoppingUser|null $shoppingUser
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereLanguage($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereMemberId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereMode($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereNumber($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereRememberToken($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereShoppingUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Customer extends Authenticatable // Erbt von Authenticatable
{
use HasFactory, Notifiable;
protected $table = 'customers';
protected $fillable = [
'name',
'email',
'shopping_user_id',
'member_id',
'number',
'language',
'user_shop_domain',
'mode',
];
// Wichtig: Laravel Auth benötigt dies, auch wenn kein Passwort verwendet wird
protected $hidden = [
'remember_token',
];
public function shoppingUser()
{
return $this->belongsTo(ShoppingUser::class, 'shopping_user_id');
}
public function member()
{
return $this->belongsTo(User::class, 'member_id');
}
}