<?php

namespace App\Exports;

use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Support\Facades\DB;

class MembersExport implements FromCollection
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        return DB::table('tickets')
            ->join('members', 'tickets.idmember', '=', 'members.idmember')
            ->select('tickets.idticket', 'members.username', 'tickets.number_ticket', 'tickets.spin_date', 'tickets.status', 'tickets.created_at', 'tickets.updated_at')->get();
    }
}
