Initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Promociones;
|
||||
use App\Models\Role;
|
||||
use App\Models\Servicio;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
|
||||
class ShowIndex extends Component
|
||||
{
|
||||
|
||||
public function render()
|
||||
{
|
||||
$promociones = Promociones::where('visible','true')->limit(4)->get();
|
||||
|
||||
$this->rol_id = Role::where('nombre','cliente')->value('id');
|
||||
|
||||
$planes = Servicio::where('estado','activo')->withMax(['tarifas' => function ($query) {
|
||||
$query->where('rol_id', $this->rol_id);
|
||||
}],'valor')->withMin(['tarifas' => function ($query) {
|
||||
$query->where('rol_id', $this->rol_id);
|
||||
}],'valor')->get();
|
||||
|
||||
return view('livewire.show-index',[
|
||||
'planes' => $planes,
|
||||
'promociones' => $promociones,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user