<?php
/**
 * Created by PhpStorm.
 * User: Sohaib
 * Date: 3/21/2019
 * Time: 5:51 PM
 */
namespace App\Models\Customers\Leads\Traits\Attribute;


trait ValidleadsAttribute
{

    public function getShowButtonAttribute()
    {
        return '<a href="' . route('admin.superadmin.validleads.show', $this) . '" class="btn btn-xs btn-info">Details</a> ';
    }

    public function getEditButtonAttribute()
    {
        return '<a href="' . route('admin.customers.validleads.edit', $this) . '" class="btn btn-xs btn-primary">Transfer</a> ';
    }

    public function getDeleteButtonAttribute()
    {

        return '<a href="' . route('admin.customers.contacts.destroy', $this) . '"
                 data-method="delete"
                 data-trans-button-cancel="' . trans('buttons.general.cancel') . '"
                 data-trans-button-confirm="' . trans('buttons.general.crud.delete') . '"
                 data-trans-title="' . trans('strings.backend.general.are_you_sure') . '"
                 class="btn btn-xs btn-danger"><i class="fa fa-trash" data-toggle="tooltip" data-placement="top" title="' . trans('buttons.general.crud.delete') . '"></i></a> ';

    }

    public function getRestoreButtonAttribute()
    {
        return '<a href="' . route('admin.superadmin.plans.restore', $this) . '" name="restore_user" class="btn btn-xs btn-info"><i class="fa fa-refresh" data-toggle="tooltip" data-placement="top" title="' . trans('buttons.backend.access.users.restore_user') . '"></i></a> ';
    }

    public function getDeletePermanentlyButtonAttribute()
    {
        return '<a href="' . route('admin.superadmin.plans.delete-permanently', $this) . '" name="delete_user_perm" class="btn btn-xs btn-danger"><i class="fa fa-trash" data-toggle="tooltip" data-placement="top" title="' . trans('buttons.backend.access.users.delete_permanently') . '"></i></a> ';
    }

    public function getActionButtonsAttribute()
    {
        if ($this->trashed()) {
            return $this->getRestoreButtonAttribute() .
                $this->getDeletePermanentlyButtonAttribute();
        }

        return
            $this->getEditButtonAttribute() .
            $this->getShowButtonAttribute();
    }
}
