Menu

## Subscription extends Model
in package
uses SoftDeletes

Subscription.php : 32

Class Subscription

Model for managing school subscriptions to plans.

##### Tags

mixin

### Table of Contents

#### Properties

$card_details : array<string|int, mixed>
$created_at : DateTime
$deleted_at : DateTime
$end_date : DateTime
$id : int
$payment_details : array<string|int, mixed>
$plan : Plan
$plan_details : array<string|int, mixed>
$plan_id : int
$school : School
$school_id : int
$status : int
$updated_at : DateTime
$user : User
$user_id : int
$casts : mixed
$dates : array<string|int, mixed>
  The attributes that should be mutated to dates.
$fillable : array<string|int, mixed>
  The attributes that are mass assignable.
$table : string
  The table associated with the model.

#### Methods

plan() : BelongsTo
  Get the plan for this subscription.
school() : BelongsTo
  Get the school for this subscription.
scopeDate() : Builder
  Scope to filter subscriptions by date range.
user() : BelongsTo
  Get the user who owns this subscription.

### Properties

#### $card_details

Subscription.php : 0
`public array<string|int, mixed> $card_details`

#### $created_at

Subscription.php : 0
`public DateTime $created_at`

#### $deleted_at

Subscription.php : 0
`public DateTime $deleted_at`

#### $end_date

Subscription.php : 0
`public DateTime $end_date`

#### $id

Subscription.php : 0
`public int $id`

#### $payment_details

Subscription.php : 0
`public array<string|int, mixed> $payment_details`

#### $plan read-only

Subscription.php : 0
`public Plan $plan`

#### $plan_details

Subscription.php : 0
`public array<string|int, mixed> $plan_details`

#### $plan_id

Subscription.php : 0
`public int $plan_id`

#### $school read-only

Subscription.php : 0
`public School $school`

#### $school_id

Subscription.php : 0
`public int $school_id`

#### $status

Subscription.php : 0
`public int $status`

#### $updated_at

Subscription.php : 0
`public DateTime $updated_at`

#### $user read-only

Subscription.php : 0
`public User $user`

#### $user_id

Subscription.php : 0
`public int $user_id`

#### $casts

Subscription.php : 60
`protected mixed $casts = ['payment_details' => 'array', 'card_details' => 'array', 'plan_details' => 'array']`

#### $dates

Subscription.php : 58

The attributes that should be mutated to dates.

`protected array<string|int, mixed> $dates = ['deleted_at']`

#### $fillable

Subscription.php : 49

The attributes that are mass assignable.

`protected array<string|int, mixed> $fillable = ['school_id', 'user_id', 'plan_id', 'end_date', 'status', 'payment_details', 'plan_details']`

#### $table

Subscription.php : 42

The table associated with the model.

`protected string $table = 'subscriptions'`

### Methods

#### plan()

Subscription.php : 87

Get the plan for this subscription.

`public plan() : BelongsTo`

##### Return values

BelongsTo

#### school()

Subscription.php : 67

Get the school for this subscription.

`public school() : BelongsTo`

##### Return values

BelongsTo

#### scopeDate()

Subscription.php : 100

Scope to filter subscriptions by date range.

`public scopeDate(Builder $query, DateTime $start, DateTime $end) : Builder`

##### Parameters

$query : Builder
$start : DateTime
$end : DateTime

##### Return values

Builder

#### user()

Subscription.php : 77

Get the user who owns this subscription.

`public user() : BelongsTo`

##### Return values

BelongsTo

## Search results