+ Homparty Part 1
This commit is contained in:
parent
74923859d1
commit
9252094a04
43 changed files with 2385 additions and 66 deletions
192
app/Models/HomepartyUser.php
Normal file
192
app/Models/HomepartyUser.php
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class HomepartyUser
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $homeparty_id
|
||||
* @property int $auth_user_id
|
||||
* @property bool $is_host
|
||||
* @property string $billing_salutation
|
||||
* @property string $billing_company
|
||||
* @property string $billing_firstname
|
||||
* @property string $billing_lastname
|
||||
* @property string $billing_address
|
||||
* @property string $billing_address_2
|
||||
* @property string $billing_zipcode
|
||||
* @property string $billing_city
|
||||
* @property int $billing_country_id
|
||||
* @property string $billing_phone
|
||||
* @property string $billing_email
|
||||
* @property bool $same_as_billing
|
||||
* @property string $shipping_salutation
|
||||
* @property string $shipping_company
|
||||
* @property string $shipping_firstname
|
||||
* @property string $shipping_lastname
|
||||
* @property string $shipping_address
|
||||
* @property string $shipping_address_2
|
||||
* @property string $shipping_zipcode
|
||||
* @property string $shipping_city
|
||||
* @property int $shipping_country_id
|
||||
* @property string $shipping_phone
|
||||
* @property string $shipping_email
|
||||
* @property bool $has_buyed
|
||||
* @property bool $subscribed
|
||||
* @property string $token
|
||||
* @property bool $token_active
|
||||
* @property string $notice
|
||||
* @property string $mode
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string $deleted_at
|
||||
* @property Carbon $user_deleted_at
|
||||
* @property User $user
|
||||
* @property Country $country
|
||||
* @property Homeparty $homeparty
|
||||
* @package App\Models
|
||||
* @property-read \App\User $auth_user
|
||||
* @property-read \App\Models\Country $billing_country
|
||||
* @property-read \App\Models\Country $shipping_country
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser newQuery()
|
||||
* @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser onlyTrashed()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereAuthUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingAddress($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingAddress2($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingCity($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingCompany($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingLastname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingPhone($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingSalutation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingZipcode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereDeletedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereHasBuyed($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereHomepartyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereIsHost($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereMode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereNotice($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereSameAsBilling($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingAddress($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingAddress2($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingCity($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingCompany($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingFirstname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingLastname($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingPhone($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingSalutation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingZipcode($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereSubscribed($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereToken($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereTokenActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereUserDeletedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser withTrashed()
|
||||
* @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser withoutTrashed()
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class HomepartyUser extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'homeparty_users';
|
||||
|
||||
protected $casts = [
|
||||
'homeparty_id' => 'int',
|
||||
'auth_user_id' => 'int',
|
||||
'is_host' => 'bool',
|
||||
'billing_country_id' => 'int',
|
||||
'same_as_billing' => 'bool',
|
||||
'shipping_country_id' => 'int',
|
||||
'has_buyed' => 'bool',
|
||||
'subscribed' => 'bool',
|
||||
'token_active' => 'bool'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'user_deleted_at'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'token'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'homeparty_id',
|
||||
'auth_user_id',
|
||||
'is_host',
|
||||
'billing_salutation',
|
||||
'billing_company',
|
||||
'billing_firstname',
|
||||
'billing_lastname',
|
||||
'billing_address',
|
||||
'billing_address_2',
|
||||
'billing_zipcode',
|
||||
'billing_city',
|
||||
'billing_country_id',
|
||||
'billing_phone',
|
||||
'billing_email',
|
||||
'same_as_billing',
|
||||
'shipping_salutation',
|
||||
'shipping_company',
|
||||
'shipping_firstname',
|
||||
'shipping_lastname',
|
||||
'shipping_address',
|
||||
'shipping_address_2',
|
||||
'shipping_zipcode',
|
||||
'shipping_city',
|
||||
'shipping_country_id',
|
||||
'shipping_phone',
|
||||
'shipping_email',
|
||||
'has_buyed',
|
||||
'subscribed',
|
||||
'token',
|
||||
'token_active',
|
||||
'notice',
|
||||
'mode',
|
||||
'user_deleted_at'
|
||||
];
|
||||
|
||||
public function homeparty()
|
||||
{
|
||||
return $this->belongsTo(Homeparty::class);
|
||||
}
|
||||
|
||||
public function auth_user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'auth_user_id');
|
||||
}
|
||||
|
||||
public function billing_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Country','billing_country_id');
|
||||
}
|
||||
|
||||
public function shipping_country()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Country','shipping_country_id');
|
||||
}
|
||||
|
||||
public function getTokenLink(){
|
||||
return url('homeparty/'.$this->token);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue