Added HTML Helpers from Laravelcollective
This commit is contained in:
parent
0736ecf29f
commit
b5c1f40a45
31 changed files with 614 additions and 220 deletions
|
|
@ -6,5 +6,31 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
class Payment extends Model
|
||||
{
|
||||
//
|
||||
protected $fillable = [
|
||||
'season_id', 'user_id', 'paid_date'
|
||||
];
|
||||
|
||||
public static function set_payment_date($user_id,$season_id,$paid_date) {
|
||||
|
||||
$payment = Payment::where([
|
||||
['user_id', '=', $user_id],
|
||||
['season_id', '=', $season_id]
|
||||
])->first();
|
||||
|
||||
if (!$payment) {
|
||||
$payment= Payment::create([
|
||||
'user_id' => $user_id,
|
||||
'season_id'=> $season_id,
|
||||
'paid_date'=> $paid_date
|
||||
]);
|
||||
|
||||
} else {
|
||||
$payment->user_id = $user_id;
|
||||
$payment->season_id = $season_id;
|
||||
$payment->paid_date = $paid_date;
|
||||
}
|
||||
|
||||
$payment->save();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue