<?php

namespace App\Http\Livewire;

use LaravelViews\Views\TableView;
use App\Models\PaymentMethods;
use App\Actions\ViewDetailPatient;
use App\Models\Especiality;
use DateTime; 
use App\Http\Livewire\ConfigSearch;

class PaymentsMethodTableView extends TableView
{
    use ConfigSearch;
    /**
     * Sets a model class to get the initial data
     */
    protected $model = PaymentMethods::class;

    public $searchBy = ['title','created_at'];


    /**
     * Sets the headers of the table as you want to be displayed
     *
     * @return array<string> Array of headers
     */
    public function headers(): array
    {
        return [
            __('common-table.table.id'), 
            __('common-table.table.paymentMethodTitle'),
            __('common-table.table.createdAt')
        ];
    }

    /**
     * Sets the data to every cell of a single row
     *
     * @param $model Current model for each row
     */
    public function row($model): array
    {
        return [
            substr($model->id,-4),
            $model->title,
            $model->created_at
        ];
    }

    /** For actions by item */
    protected function actionsByRow(){
        return [
           
        ];
    }
}
