namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Config\Repository as Config;
class Setting extends Model
{ /*
public function __construct(protected Config $config)
{
parent::__construct();
}
*/
protected $fillable = ['value'];
public function isImage($value): bool {
//$imageExtensions = $this->config->get('custom.allowed_image_extensions');
$imageExtensions = \Illuminate\Support\Facades\Config::get('custom.allowed_image_extensions');
$extension = strtolower(pathinfo($value, PATHINFO_EXTENSION));
return in_array($extension, $imageExtensions);
}
}