Add a general-purpose tools page to your Filament project. 🛠

Overview

Add a general-purpose tools page to your Filament project.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Screenshot of Page

Installation

You can install the package via Composer:

composer require ryangjchandler/filament-tools

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-tools-views"

Usage

This package will automatically register a new RyanChandler\FilamentTools\Tools page in your Filament panel.

Registering a new tool

You can register a new tool by calling the Tools::register() function, providing a Closure as the only argument.

use RyanChandler\FilamentTools\Tools;
use RyanChandler\FilamentTools\Tool;

public function boot()
{
    Tools::register(function (Tool $tool): Tool {
        return $tool->label('Clear Cache');
    });
}

All tools require a label. If a label isn't provided, an instance of RyanChandler\FilamentTools\Exception\ToolsException will be thrown.

The provided Closure will be executed via the container so you can type-hint any dependencies you need.

Tool forms

Each tool can contain it's own unique form. This form makes is simple to ask for input from the user and execute logic based on that input. You can provide your form's schema to the Tool::schema() method.

Tools::register(function (Tool $tool): Tool {
    return $tool
        ->label('Clear Cache')
        ->schema([
            TextInput::make('tag')
                ->nullable(),
        ]);
});

To run some logic when the form is submitted you can use the Tool::onSubmit() method, providing a Closure as the only argument. This Closure will receive an instance of RyanChandler\FilamentTools\ToolInput. This class extends Illuminate\Support\Collection so you are free to call any existing Collection methods.

Tools::register(function (Tool $tool): Tool {
    return $tool
        ->label('Clear Cache')
        ->schema([
            TextInput::make('tag')
                ->nullable(),
        ])
        ->onSubmit(function (ToolInput $input) {
            $tag = $input->get('tag');

            // Do something cool here...
        });
});

Rendering a custom view

You can provide a custom view to render inside of the tool by calling the Tool::view() method.

Tools::register(function (Tool $tool): Tool {
    return $tool
        ->label('Clear Cache')
        ->view('tools.clear-cache');
});

Customising the column span

Each row on the tools page operates on a 12-column grid. The default width for a tool is 3 columns.

If you would like to customise the width of your tool, you can use the Tool::columnSpan() method.

Tools::register(function (Tool $tool): Tool {
    return $tool
        ->label('Clear Cache')
        ->columnSpan(6);
});

Authorization

By default, all users will be able to access the Tools page. If you would like to customise this behaviour and restrict access to certain users, you can use the Tools::can() method.

public function boot()
{
    Tools::can(function (User $user): bool {
        return $user->role === Role::Admin;
    });
}

If this callback returns false, the navigation items will not be registered and anybody trying to access the route directly will receive a 403 response.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
Releases(v0.4.1)
  • v0.4.1(Apr 25, 2022)

    What's Changed

    • build(deps): bump dependabot/fetch-metadata from 1.2.1 to 1.3.0 by @dependabot in https://github.com/ryangjchandler/filament-tools/pull/7
    • build(deps): bump dependabot/fetch-metadata from 1.3.0 to 1.3.1 by @dependabot in https://github.com/ryangjchandler/filament-tools/pull/10
    • added a gap to improve visualization when there are multiple tools by @inerba in https://github.com/ryangjchandler/filament-tools/pull/9

    New Contributors

    • @inerba made their first contribution in https://github.com/ryangjchandler/filament-tools/pull/9

    Full Changelog: https://github.com/ryangjchandler/filament-tools/compare/v0.4.0...v0.4.1

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Mar 4, 2022)

    What's Changed

    • feature: support clearing form data on submit (see docs)

    Full Changelog: https://github.com/ryangjchandler/filament-tools/compare/v0.3.0...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Feb 27, 2022)

    What's Changed

    • build(deps): bump dependabot/fetch-metadata from 1.1.1 to 1.2.0 by @dependabot in https://github.com/ryangjchandler/filament-tools/pull/3
    • chore: support l9 by @ryangjchandler in https://github.com/ryangjchandler/filament-tools/pull/4

    New Contributors

    • @dependabot made their first contribution in https://github.com/ryangjchandler/filament-tools/pull/3
    • @ryangjchandler made their first contribution in https://github.com/ryangjchandler/filament-tools/pull/4

    Full Changelog: https://github.com/ryangjchandler/filament-tools/compare/v0.2.0...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jan 23, 2022)

    Added

    • Added support for authorizing tools access.

    Full Changelog: https://github.com/ryangjchandler/filament-tools/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jan 23, 2022)

Owner
Ryan Chandler
Ryan Chandler
Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

Ryan Chandler 45 Dec 26, 2022
Add a progress bar column to your Filament tables.

Add a progress bar column to your Filament tables. This package provides a ProgessColumn that can be used to display a progress bar in a Filament tabl

Ryan Chandler 22 Nov 12, 2022
A simple profile management page for Filament. ✨

A simple profile page for Filament. This package provides a very simple Profile page that allows the current user to manage their name, email address

Ryan Chandler 65 Jan 5, 2023
Easily add Laravel Telescope and Horizon to Filament admin panel.

Filament Debugger This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Installation You can inst

Stephen Jude 5 Nov 24, 2022
A package that helps to group methods that mostly use for the view presentation purpose.

A package that helps to group methods that mostly use for the view presentation purpose form models to a dedicated presenter class.

Touhidur Rahman 9 Apr 26, 2022
Adds a widget and REST endpoint for the purpose of displaying post revisions inline on the frontend.

Post History This widget allows visitors to easily diff posts against their earlier revisions, displaying diffs of HTML inline. It should be plug and

Human Made 4 Dec 12, 2022
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

WebDevEtc. 227 Dec 25, 2022
Easily add all the 58 Algerian Wilayas and its Dairas to your cool Laravel project (Migrations, Seeders and Models).

Laravel-Algereography Laravel-Algereography allows you to add Migrations, Seeders and Models of Algerian Wilayas and Dairas to your existing or new co

Hocine Saad 48 Nov 25, 2022
Easily interact and control your feature flags from Filament

Easily interact and control your feature flags from Filament

Ryan Chandler 32 Nov 29, 2022
Manage your own workflows with filament

Filament Workflow Manager This package provides a Filament resource where you can configure and manager your workflows, and also provides some functio

EL OUFIR Hatim 41 Jan 2, 2023
Filament Plugin to help implement Cloudflare turnstile into your forms.

Filament Turnstile Filament Turnstile, is a plugin to help you implement the Cloudflare turnstile. This plugin uses Laravel Turnstile Behind the scene

Coderflex 5 Jun 12, 2023
A Laravel Admin Starter project with Page Builder, Roles, Impersonation, Analytics, Blog, News, Banners, FAQ, Testimonials and more

Laravel CMS Starter Project A Laravel CMS Starter project with AdminLTE theme and core features. Preview project here User: [email protected]

Ben-Piet O'Callaghan 306 Nov 28, 2022
Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.

Laravel 2-Step verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Laravel 2-Step Authentication Verification for Laravel. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects.

Jeremy Kenedy 204 Dec 23, 2022
The Most Popular JavaScript Calendar as a Filament Widget 💛

The Most Popular JavaScript Calendar as a Filament Widget ?? Features Accepts all configurations from FullCalendar Event click and drop events Upcomin

Guilherme Saade 62 Dec 31, 2022
A single-field repeater for Filament. ⚡️

A single-field repeater for Filament. This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Insta

Ryan Chandler 3 Mar 5, 2022
A convenient helper for using the laravel-seo package with Filament Admin and Forms

Combine the power of Laravel SEO and Filament PHP. This package is a convenient helper for using the laravel-seo package with Filament Admin and Forms

Ralph J. Smit 39 Dec 21, 2022
Admin user, role and permission management for Laravel Filament

Filament Access Control Opinionated setup for managing admin users, roles and permissions within Laravel Filament Features Separate database table for

Elisha Witte 69 Jan 4, 2023
Build structured navigation menus in Filament.

Build structured navigation menus in Filament. This plugin for Filament provides a Navigation resource that allows to build structural navigation menu

Ryan Chandler 61 Dec 30, 2022
Access laravel log through Filament admin panel

Access laravel log through Filament admin panel Features Syntax highlighting Quickly jump between start and end of the file Refresh log contents Clear

Guilherme Saade 20 Nov 22, 2022