Download the PHP package miguilim/filament-auto-panel without Composer

On this page you can find all versions of the php package miguilim/filament-auto-panel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-auto-panel

Filament Auto Panel

Latest Version on Packagist Total Downloads

Construct your Filament panel Resources and Relation Managers at execution time like magic. This package provide custom Resources and Relation Managers classes that mounts it table, create, view and edit pages at execution time by scanning the database current table schema while still giving you the freedom to create actions, widgets and various customizations to your panel.

[!IMPORTANT] This package is intended for admin panels, similar to how Laravel Nova works + everything auto-generated. You can also think it as a database management tool. If you feels you need a more customized resource workflow, re-consider to not use this package.

Contents

Installation

You can install the package via composer:

Usage

Before getting started with the package, you must know some behaviors that the table schema reader have. The package takes into consideration your actual table schema in the database and not your migration file. However, it is extremely important to use the correct fields in the migration in order to generate the correct columns.

An example of that is when you use the boolean() column method, Laravel will generate a tinyint(1) table column. This specific column type and length will be used by Filament Auto Panel to detect its a boolean column. If you use the tinyInteger() method, it will generate a tinyint(4) table column, and therefore will be identified as a numeric column, even if in its context it is being used as a boolean.

[!NOTE] You can overwrite this auto-detection behavior by setting the cast for the column in your model class.

Soft Deletes

The package detects if the table has soft deletes or not by checking if it has the SoftDeletes trait, by checking if getDeletedAtColumn method exists in the model. If soft deletes is detected, it will append the TrashedFilter to the table filters.

Primary Key

Filament Auto Panel tries to detect the primary key by calling the getKeyName() method from the resource / relation manager model. The primary key is searchable by default and it will also be copyable in table and infolist view.

Relationship Linking

The package tries to link any columns that ends with _id with a belongsTo relationship. It sets a searchable Select for create/edit actions, and an URL linking to the respective resource in table and infolists (if the resource exists).

[!NOTE] This linking currently do not support morphsTo detection. PRs are welcome!

Intrusive Mode

Auto Resources and Auto Relation Managers have the intrusive mode by default. When this mode is activated, the create and edit actions will not respect the $fillable and $hidden model attributes. If you would like to disable this behavior, you can set protected static bool $intrusive = false; in your resource or relation manager class.

Default Pages

By default, the Auto Resource have a list and view pages. The create and edit record is available as a modal action in the list and view pages respectively.

Default Actions

By default, Auto Resource appends the following default actions:

and Auto Relation Manager appends the following default actions:

Default Sorting

By default, the Auto Resource and Auto Relation Manager tries to set the table default sort for the following columns, in priority order respectively: primary key (only if incremented), created_at (if exists), updated_at (if exists).

[!NOTE] You can customize the defaultSort() of your table (and any other method) by extending the table(Table $table) and use parent::table($table)->defaultSort(...).

Auto Resource

You can get started by creating your first Auto Resource using the following command:

This command creates the Auto Resource class for you, just as the default filament command. However, it uses the AutoResource class instead. You don't need to list anything now, you can just access the resource page and see the magic!

Auto Relation Manager

Auto Relation Manager construct a table containing the all relationship model columns, excluding the related id or morph. You can generate your Auto Relation Manager using the following command:

This command creates the Auto Relation Manager for you and you must list it in the getRelations() method of your resource. However, sometimes you may want something more handier. You can create a relation manager inside your resource using the RelationManagerMounter. See the following example of how it works:

Auto Action

The Auto Resource and Auto Relation Manager provides a getActions() method, however you cannot use the default Filament action on it.

Instead, you must use the AutoAction class. This action type have same methods as Filament Actions, however it provide new methods to set where the action will be shown. This is needed since there is only this array for all resource action positions.

The resource action closure always receive a collection of models. See how it works in the example below:

[!NOTE] By default the auto action are not shown anywhere, so you must set at least one of the following methods: showOnTable(), showOnBulkAction() or showOnViewPage().

Enum Dictionary

Enum dictionary is a feature available to help you formatting a value from a column for your resource. This feature sets a badge() in table and infolist, and use a Select in the form with the values you set. You can use it in the following way:

You may customize the badge colors with the following syntax:

Visible Columns

By default all columns are shown in the Auto Resource or Auto Relation Manager table. You can customize the columns visibility using:

This feature only sets the column default visibility in the top-right menu of your table. You can enable/disable any column visibility at any time using the panel.

[!NOTE] You cannot customize form or infolist columns visibility.

Searchable Columns

You can set searchable columns for your Auto Resource or Auto Relation Manager using:

You have the following searchable options to use: global, individual or both.

Overwrite Columns

Sometimes you may want to customize the resource columns entirely, you can overwrite the table column, form field or infolist entry with the getColumnsOverwrite method:

[!NOTE] You cannot append new columns using this method, only overwrite detected columns. The make() parameter name must be the same as the column name in the database.

Widgets

You can set widgets to the list and view pages for your Auto Resource independently in the following way:

Extra Pages

You can append extra pages to your Auto Resource using the getExtraPages method:

License

Filament Auto Panel is open-sourced software licensed under the MIT license.


All versions of filament-auto-panel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
filament/filament Version ^3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package miguilim/filament-auto-panel contains the following files

Loading the files please wait ....