PHPackages                             islamdb/orchid-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. islamdb/orchid-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

islamdb/orchid-helper
=====================

Helper for orchid platform

752611PHP

Since Jun 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/islamdb/orchid-helper)[ Packagist](https://packagist.org/packages/islamdb/orchid-helper)[ RSS](/packages/islamdb-orchid-helper/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (1)

Introduction
============

[](#introduction)

Orchid Helper has class and traits that will help you a lot in development

Installation
============

[](#installation)

> The manual assumes that you already have a copy of [Laravel](https://laravel.com/docs/installation) with [Orchid](https://orchid.software/en/docs/installation/)

You can install the package using the Сomposer. Run this at the command line:

```
composer require islamdb/orchid-helper
```

This will update `composer.json` and install the package into the `vendor/` directory.

Traits
======

[](#traits)

ResourceDefaultAllowedSortsAndFilters
-------------------------------------

[](#resourcedefaultallowedsortsandfilters)

This trait will make the `$allowedSorts` and `$allowedFilters` filled. Depand on `$fillable` in your Model

#### Usage

[](#usage)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceDefaultAllowedSortsAndFilters;

class YourModel extends Model
{
    use ResourceDefaultAllowedSortsAndFilters;

    ...
}
```

ResourceDefaultFilter
---------------------

[](#resourcedefaultfilter)

This trait will make default sorted in your resource

#### Usage

[](#usage-1)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceDefaultFilter;

class YourResource extends Resource
{
    use ResourceDefaultFilter;

    ...
}
```

You can change `$defaultSortedColumn` and `$defaultSortedOrder` in **construct**

ResourceDefaultLabel
--------------------

[](#resourcedefaultlabel)

This trait will change the default label of your Resource name

#### Usage

[](#usage-2)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceDefaultLabel;

class YourResource extends Resource
{
    use ResourceDefaultLabel;

    ...
}
```

This will change from "Your Resource" to "Your". But you can change `static $labelToReplace` value in construct

ResourceDefaultSortingByFilename
--------------------------------

[](#resourcedefaultsortingbyfilename)

This trait will sort your resources by filename

#### Usage

[](#usage-3)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceDefaultSortingByFilename;

class YourResource extends Resource
{
    use ResourceDefaultSortingByFilename;

    ...
}
```

ResourceDeleteAction
--------------------

[](#resourcedeleteaction)

This trait will give default delete action

#### Usage

[](#usage-4)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceDeleteAction;

class YourResource extends Resource
{
    use ResourceDeleteAction;

    ...
}
```

ResourceOnSave
--------------

[](#resourceonsave)

This trait will help you to save your attachment and sluggable in resource

#### Usage

[](#usage-5)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceOnSave;

class PostResource extends Resource
{
    use ResourceOnSave;

    public function onSave(ResourceRequest $request, Model $model)
    {
        $this->sluggable($request);

        $this->saveWithAttachment($request, $model);
    }

    ...
}
```

ResourceDefault
---------------

[](#resourcedefault)

All traits before are in this trait

#### Usage

[](#usage-6)

```
use IslamDB\OrchidHelper\Resource\Traits\ResourceDefault;

class YourResource extends Resource
{
    use ResourceDefault;

    ...
}
```

Field
=====

[](#field)

This class is used by Orchid Setting package. You can visit [islamdb/orchid-setting](https://github.com/islamdb/orchid-setting)

Input Types
-----------

[](#input-types)

```
Field::INPUT_EMAIL // 'email'
Field::INPUT_FILE // 'file'
Field::INPUT_HIDDEN // 'hidden'
Field::INPUT_MONTH // 'month'
Field::INPUT_NUMBER // 'number'
Field::INPUT_PASSWORD // 'password'
Field::INPUT_RADIO // 'radio'
Field::INPUT_RANGE // 'range'
Field::INPUT_SEARCH // 'search'
Field::INPUT_TEL // 'tel'
Field::INPUT_TEXT // 'text'
Field::INPUT_TIME // 'time'
Field::INPUT_URL // 'url'
Field::INPUT_WEEK // 'week'
```

Required Methods
----------------

[](#required-methods)

```
\IslamDB\OrchidHelper\Field::REQUIRED_METHODS
```

#### Value

[](#value)

```
[
    RadioButtons::class => [
        'options' => "['one' => 'One', 'two' => 'Two', 'three' => 'Three']"
    ], Range::class => [
        'min' => "1",
        'max' => "100",
        'step' => "1"
    ], Select::class => [
        'options' => "['one' => 'One', 'two' => 'Two', 'three' => 'Three']"
    ], Picture::class => [
        'targetId' => ''
    ]
]
```

With Meta
---------

[](#with-meta)

Returne meta fields with Field params

```
// function
public static function withMeta(array $fields)

// usage
\IslamDB\OrchidHelper\Field::withMeta([
    View::make('group'),
    View::make('slug'),
    Input::make('title'),
    View::make('body'),
    View::dateTime('published_at'),
    View::dateTime('expired_at')
])
```

Check File Field
----------------

[](#check-file-field)

Check wether type is file field or not

```
// function
public static function isFileField($type)

// usage
\IslamDB\OrchidHelper\Field::isFileField(\Orchid\Screen\Fields\Input::class) // false
```

Get All Fields
--------------

[](#get-all-fields)

Get all available orchid fields

```
// function
public static function all(bool $withMethods = true, $typeClass = null)

// usage
\IslamDB\OrchidHelper\Field::all()
```

Find Field
----------

[](#find-field)

Find field by class name and return methods etc

```
// function
public static function find($type, bool $withMethods = true)

// usage
\IslamDB\OrchidHelper\Field::find(\Orchid\Screen\Fields\Matrix::class)
```

Generate Field
--------------

[](#generate-field)

Generate field by class name with options (Orchid Setting)

```
public static function make($type, string $name = 'value', array $options = [])
```

Column
======

[](#column)

Usage
-----

[](#usage-7)

```
use IslamDB\OrchidHelper\Column;
```

Make
----

[](#make)

This function will help you to make column with default title, sorting and filter

```
public static function make($name, $title = null, bool $sorting = true, $filter = TD::FILTER_TEXT)
```

#### Example

[](#example)

```
Column::make('full_name')
```

#### Output

[](#output)

```
(column with "Full Name" column name and filter)
```

URL
---

[](#url)

Use this function to generate url table column

```
public static function url(string $name, string $title = null, $target = '_blank')
```

#### Example

[](#example-1)

```
Column::url('social_media_url', null, null)
Column::url('social_media_url', null, '_blank')
```

#### Output

[](#output-1)

```
1. (clickable and go to address in current tab)
2. (clickable and go to address in new tab)
```

HTML
----

[](#html)

This function will help you to print html

```
public static function html(string $name, string $title = null)
```

#### Example

[](#example-2)

```
Column::html('body')
```

#### Output

[](#output-2)

***Bold Text***

```
Bold Text
```

Relation
--------

[](#relation)

This function will help you to print out the relation fields

```
public static function relation(string $name, string $title = null, $columns = 'name', string $glue = ', ', string $glueColumn = ' ')
```

#### Example

[](#example-3)

Assume that you want to get users with their roles and roles are (super admin and administrator)

```
Column::relation('roles', null, ['name', 'slug'], ', ', ' - ')
```

#### Output

[](#output-3)

```
Super Admin - super-admin, Administrator - administrator
```

Boolean
-------

[](#boolean)

This function will help you to print out the boolean value

```
public static function boolean($name, $title = null, array $labels = null)
```

#### Example

[](#example-4)

```
Column::boolean('enabled', 'Is Active', [true => 'Yes', false => 'No'])
```

#### Output

[](#output-4)

```
Yes/No (depand on your value)
```

Date Time
---------

[](#date-time)

This function will help you to print out datetime/timestamp

```
public static function dateTime($name, $title = null, string $locale = 'id', $withTime = true, $withDayName = true)
```

#### Example

[](#example-5)

```
Column::dateTime('updated_at', 'Last Edit', 'en', true, true)
```

#### Output

[](#output-5)

```
Tuesday, August 31st 2021, 09:05:38 (depand on your value)
```

Money/Numeric
-------------

[](#moneynumeric)

This function will help you to print numeric/money value

```
public static function money($name, $title = null, $decimals = 2, $zeroTrail = true, $decimalSeparator = '.', $thousandSeparator = ',')
```

#### Example

[](#example-6)

```
1. Column::make('total', null, 4, true)
2. Column::make('total', null, 4, false)
```

#### Output

[](#output-6)

```
1. 250,000.23
2. 250,000.2300
```

Shortcut
--------

[](#shortcut)

This function will help you to view/edit resource

```
public static function shortcut($name, $title = null, string $route = 'platform.resource.view', int $deep = 2)
```

#### Example

[](#example-7)

```
1. Column::shortcut('name', null, 'platform.resource.view')
2. Column::shortcut('name', null, 'platform.resource.edit')
```

#### Output

[](#output-7)

```
1. (clickable, and go to view page)
2. (clickable, and go to edit page)
```

View
====

[](#view)

Usage
-----

[](#usage-8)

```
use IslamDB\OrchidHelper\View;
```

Make
----

[](#make-1)

This function will help you to make sight with default title

```
public static function make(string $name, string $title = null)
```

#### Example

[](#example-8)

```
View::make('full_name')
```

#### Output

[](#output-8)

```
(view with "Full Name")
```

URL
---

[](#url-1)

Use this function to generate url in view page

```
public static function url(string $name, string $title = null, string $target = '_blank')
```

#### Example

[](#example-9)

```
1. View::url('social_media_url', null, null)
2. View::url('social_media_url', null, '_blank')
```

#### Output

[](#output-9)

```
1. (clickable and go to address in current tab)
2. (clickable and go to address in new tab)
```

HTML
----

[](#html-1)

This function will help you to print html

```
public static function html(string $name, string $title = null)
```

#### Example

[](#example-10)

```
View::html('body')
```

#### Output

[](#output-10)

***Bold Text***

```
Bold Text
```

Relation
--------

[](#relation-1)

This function will help you to print out the relation fields

```
public static function relation(string $name, string $title = null, $columns = 'name', string $glue = ', ', string $glueColumn = ' ')
```

#### Example

[](#example-11)

```
View::relation('roles', null, ['name', 'slug'], ', ', ' - ')
```

#### Output

[](#output-11)

```
Super Admin - super-admin, Administrator - administrator
```

Boolean
-------

[](#boolean-1)

This function will help you to print out the boolean value

```
public static function boolean($name, $title = null, array $labels = null)
```

#### Example

[](#example-12)

```
View::boolean('enabled', 'Is Active', [true => 'Yes', false => 'No'])
```

#### Output

[](#output-12)

```
Yes/No (depand on your value)
```

Date Time
---------

[](#date-time-1)

This function will help you to print out datetime/timestamp

```
public static function dateTime($name, $title = null, string $locale = 'id', $withTime = true, $withDayName = true)
```

#### Example

[](#example-13)

```
View::dateTime('updated_at', 'Last Edit', 'en', true, true)
```

#### Output

[](#output-13)

```
Tuesday, August 31st 2021, 09:05:38 (depand on your value)
```

Money/Numeric
-------------

[](#moneynumeric-1)

This function will help you to print numeric/money value

```
public static function money($name, $title = null, int $decimals = 2, bool $zeroTrail = true, string $decimalSeparator = '.', string $thousandSeparator = ',')
```

#### Example

[](#example-14)

Assume total = 250000.23

```
1. View::make('total', null, 4, true)
2. View::make('total', null, 4, false)
```

#### Output

[](#output-14)

```
1. 250,000.23
2. 250,000.2300
```

Meta View
---------

[](#meta-view)

Return meta sights

```
public static function meta(): array
{
    return [
        static::make('meta_title'),
        static::make('meta_keywords'),
        static::make('meta_description')
    ];
}
```

Timestamps View
---------------

[](#timestamps-view)

Return timestamp sights

```
public static function timestamps(): array
{
    return [
        static::dateTime('created_at'),
        static::dateTime('updated_at')
    ];
}
```

With Meta View
--------------

[](#with-meta-view)

Return meta sights with array sight params

```
public static function withMeta(array $views): array
{
    return array_merge($views, static::meta());
}
```

With Timestamps
---------------

[](#with-timestamps)

Return timestamp sights with array sight params

```
public static function withTimestamps(array $views): array
{
    return array_merge($views, static::timestamps());
}
```

With Meta &amp; Timestamps
--------------------------

[](#with-meta--timestamps)

Return meta timestamp sights with array sight params

```
public static function withMetaAndTimestamps(array $view): array
{
    return array_merge($view, static::meta(), static::timestamps());
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e8619c9135f435e1fd024209a87d86483d0a053757057bd2e0ae1dfb676ca26?d=identicon)[islamdb](/maintainers/islamdb)

---

Top Contributors

[![islamdb](https://avatars.githubusercontent.com/u/74500511?v=4)](https://github.com/islamdb "islamdb (27 commits)")[![rafyakbar](https://avatars.githubusercontent.com/u/22675316?v=4)](https://github.com/rafyakbar "rafyakbar (24 commits)")[![kresnayulianta](https://avatars.githubusercontent.com/u/20910360?v=4)](https://github.com/kresnayulianta "kresnayulianta (3 commits)")

### Embed Badge

![Health badge](/badges/islamdb-orchid-helper/health.svg)

```
[![Health](https://phpackages.com/badges/islamdb-orchid-helper/health.svg)](https://phpackages.com/packages/islamdb-orchid-helper)
```

###  Alternatives

[stuttter/wp-user-profiles

A sophisticated way to edit users in WordPress

11219.3k1](/packages/stuttter-wp-user-profiles)[fof/analytics

Tracks analytics using Google Analytics, Google Optimize/GTM and Matomo

3543.1k](/packages/fof-analytics)[malarzm/collections

Various implementations of Doctrine's Collection interface

2368.1k](/packages/malarzm-collections)[chrico/wp-fields

Package which provides some re-usable fields for WordPress.

1981.2k](/packages/chrico-wp-fields)[aertmann/history

An improved history backend module for Neos

1070.2k](/packages/aertmann-history)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
