PHPackages                             mahmoud-mosaad/backpack-fields - 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. mahmoud-mosaad/backpack-fields

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

mahmoud-mosaad/backpack-fields
==============================

Adds custom fields which useful for certain purposes to Backpack Laravel.

1211Blade

Since Oct 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mahmoud-mosaad/backpack-fields)[ Packagist](https://packagist.org/packages/mahmoud-mosaad/backpack-fields)[ RSS](/packages/mahmoud-mosaad-backpack-fields/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Custom Fields for Backpack 4.\*
===============================

[](#custom-fields-for-backpack-4)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cc169490e63ae499c76f5ae0a6c542d7dbdb8cf2ac17eba196fc96086c4e26bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61686d6f75642d6d6f736161642f6261636b7061636b2d6669656c64732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahmoud-mosaad/backpack-fields)[![Total Downloads](https://camo.githubusercontent.com/950c0b00992eff5c9b3342a6ed28376610e2d9a6802aad6db229bb6a32a92049/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61686d6f75642d6d6f736161642f6261636b7061636b2d6669656c64732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahmoud-mosaad/backpack-fields)

This package provides custom fields type for the [Backpack for Laravel](https://backpackforlaravel.com/) administration panel. The `_toggle` fields allows admins to ***toggle*** another fields as dependency, in a prettier way. The `_array_ajax` fields adds select from array not ***relationships*** only

> **This package has been created to make it easy for developers to share their custom fields with the Backpack community. You can use this package to get fields type, sure. But you can also fork it, to create a Backpack addon. For more information on how to do this, check out Backpack's addon docs.**

Screenshots
-----------

[](#screenshots)

[![Select From Array Toggle](https://camo.githubusercontent.com/cbfd9325973713f1dd8a8440bc327dd6be2f423916414c7229e9edb4a1ca973f/68747470733a2f2f692e696d6775722e636f6d2f6e34634238734a2e676966)](https://camo.githubusercontent.com/cbfd9325973713f1dd8a8440bc327dd6be2f423916414c7229e9edb4a1ca973f/68747470733a2f2f692e696d6775722e636f6d2f6e34634238734a2e676966)

Installation
------------

[](#installation)

Via Composer

```
composer require mahmoud-mosaad/backpack-fields
```

Usage
-----

[](#usage)

Inside your custom CrudController:

```
$this->crud->addField([
    'name' => 'from_place',
    'type'  => 'select_from_array_toggle',
    'label' => 'From Places',
    'options' => [
        1 => 'First',
        2 => 'Second',
        3 => 'Third',
        4 => 'Fourth',
        100 => 'Other',
    ],
    'allows_null' => false,
    'show_when' => [
        100 => [
            'from_place_other'
        ]
    ],
]);

$this->crud->addField([
    'name' => 'from_place_other',
    'label' => trans('backpack::base.other'),
    'type' => 'text',
]);
```

**Publish Views.** Copy-paste the blades to your directory:

```
# Publish Vendor Views to resources (Win CMD)
xcopy .\vendor\mahmoud-mosaad\backpack-fields\src\resources\views\crud\fields .\resources\views\vendor\backpack\crud\fields\

# Publish Vendor Views to resources (Bash)
cp .\vendor\mahmoud-mosaad\backpack-fields\src\resources\views\crud\fields .\resources\views\vendor\backpack\crud\fields\
```

**Uninstall this package.** Since it only provides fields you already published and you're no longer using those files, it makes no sense to have the package installed:

```
composer remove mahmoud-mosaad/backpack-fields
```

Credits
-------

[](#credits)

- [Mahmoud Mosaad](https://www.linkedin.com/in/mahmoudmosaad50/) - Author

License
-------

[](#license)

MIT. Please see the [license file](LICENSE) for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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/a14c56517728dd9d5302ea3eac775e99b852a71755104e81c48605c597df4e2a?d=identicon)[mahmoud-mosaad](/maintainers/mahmoud-mosaad)

---

Top Contributors

[![mahmoud-mosaad](https://avatars.githubusercontent.com/u/14305894?v=4)](https://github.com/mahmoud-mosaad "mahmoud-mosaad (21 commits)")

### Embed Badge

![Health badge](/badges/mahmoud-mosaad-backpack-fields/health.svg)

```
[![Health](https://phpackages.com/badges/mahmoud-mosaad-backpack-fields/health.svg)](https://phpackages.com/packages/mahmoud-mosaad-backpack-fields)
```

PHPackages © 2026

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