When a new user registers with a referral code, their tarifas and promos are now copied from the referring user. Also refactored Usuario_promo and Usuario_tarifa models to use fillable attributes and improved method formatting. Added Swiper CSS/JS to app layout.
30 lines
540 B
PHP
Executable File
30 lines
540 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Usuario_promo extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'usuario_id',
|
|
'promocion_id',
|
|
'precio',
|
|
'utilidad',
|
|
'visible',
|
|
];
|
|
|
|
public function usuario()
|
|
{
|
|
return $this->belongsTo(User::class, 'usuario_id');
|
|
}
|
|
|
|
public function promocion()
|
|
{
|
|
return $this->belongsTo(Promociones::class, 'promocion_id');
|
|
}
|
|
}
|