CasperSecurity

Current Path : /var/www/orientalss.com/app/Http/Livewire/Report/
Upload File :
Current File : /var/www/orientalss.com/app/Http/Livewire/Report/BreakdownReportLivewire.php

<?php

namespace App\Http\Livewire\Report;

use App\Models\Organisation;
use App\Models\VehicleBreakdown;
use Carbon\Carbon;
use Livewire\Component;

class BreakdownReportLivewire extends Component
{
    public $search;
    public $perPage = 10;
    public $orderBy = 'id';
    public $orderAsc = 'asc';
    public $from_date, $to_date, $data;

    public function closemodalclick()
    {
        $this->resetValidation();
        $this->datatable = [];
    }

    public function mount()
    {
        $this->from_date = Carbon::now()->format('Y-m-d');
        $this->to_date = Carbon::now()->format('Y-m-d');
        $this->orderBy = 'id';
    }

    public function read()
    {
        $query = VehicleBreakdown::select('vehicle_breakdowns.*','manage_vehicles.vehicle_registration_no')
            ->join('manage_vehicles', 'vehicle_breakdowns.vehicle_id', '=', 'manage_vehicles.id')
            ->where('vehicle_breakdowns.status', 1);
        $query->where(function($query) {
            $query->orWhere('manage_vehicles.vehicle_registration_no', 'LIKE', '%' . $this->search . '%');
        });

        if (!empty($this->from_date) && !empty($this->to_date)) {
            $fromDate = Carbon::parse($this->from_date)->startOfDay();
            $toDate = Carbon::parse($this->to_date)->endOfDay();
            $query->whereBetween('vehicle_breakdowns.created_at', [$fromDate, $toDate]);
        }

        return $query->paginate($this->perPage);
    }

    public function render()
    {
        $org = Organisation::latest()->first();
        $datatable = $this->read();
        return view('livewire.report.breakdown-report-livewire',compact('datatable','org'));
    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY