Current File : //home/tradevaly/demo.tradevaly.com.bd/app/Models/Duration.php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Duration extends Model
{
    use HasFactory;
    use SoftDeletes;

    protected $fillable = [
        'created_user_id', 'modified_user_id', 'deleted_user_id', 'name', 'status', 'updated_at'
    ];


     protected function getDuration($conditions  = [])
    {   
        $data = Duration::where('status', 1)->where($conditions)->pluck('name', 'id')->toArray();

        $rearrange['dayWithoutText'] = $data;

        foreach ($data as $key => $value) {
            $rearrange['dayWithText'][$key] = $value.' Days';
        }
        return $rearrange;
    }
}