source: app/Models/Transaction.php@ dfae77e

Last change on this file since dfae77e was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 898 bytes
RevLine 
[dfae77e]1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7use Illuminate\Database\Eloquent\Relations\BelongsTo;
8use Laravel\Cashier\Subscription as CashierSubscription;
9
10class Transaction extends Model
11{
12 use HasFactory;
13
14 protected $table = 'transactions';
15
16 /**
17 * The attributes that are mass assignable.
18 *
19 * @var array<int, string>
20 */
21 protected $fillable = [
22 'name',
23 'stripe_id',
24 'stripe_price',
25 'quantity',
26 'offer_id',
27 'invoice_id',
28 ];
29
30 /**
31 * The attributes that should be cast.
32 *
33 * @var array<string, string>
34 */
35 protected $casts = [
36 'trial_ends_at' => 'datetime',
37 'ends_at' => 'datetime',
38 ];
39
40 public function offer(): BelongsTo
41 {
42 return $this->belongsTo(Offer::class);
43 }
44}
Note: See TracBrowser for help on using the repository browser.