Git Product home page Git Product logo

filament-addons's Introduction

Filament Addons

A set of components, fields and layouts to extend Filament Admin.

Installation

composer require awcodes/filament-addons

(Optional) Publish config file

php artisan vendor:publish --tag=filament-addons-config

Themeing

If you are using a custom theme for Filament you will need to add this plugin's views to your Tailwind CSS config. Once this is done you may disable the plugin's stylesheet in the config file by changing 'load_styles' to false.

content: [
    ...
    "./vendor/awcodes/filament-addons/resources/views/**/*.blade.php",
],

Admin

Fixed Sidebar Layout

Just return it directly from your form function in your model resource.

use FilamentAddons\Admin\FixedSidebar;

public static function form(Form $form): Form
{
    return FixedSidebar::make()
        ->schema([
            // Main section form components
        ], [
            // Sidebar form components
        ]);
}

Forms


Date Input

date input

use FilamentAddons\Forms\Fields\DateInput;

DateInput::make(string $fieldname)
    ->label('Publish Date')
    ->withoutTime() //optional

Password Generator

password generator

All methods from TextInput are available.

use FilamentAddons\Forms\Fields\PasswordGenerator;

PasswordGenerator::make(string $fieldname)
    ->passwordLength(int $length = 12)
    ->hasNumbers(bool $hasNumbers = true)
    ->hasSymbols(bool $hasSymbols = true)

Title With Slug

title with slug title with slug open

Creates a TextInput with the ability to modify the slug after creation, but preserves the slug when editing to help with SEO.

use FilamentAddons\Forms\Components\TitleWithSlug;

TitleWithSlug::make(
    string $titleFieldName = 'title',
    string $slugFieldName = 'slug',
    string|Closure $basePathForResource = '/'
)->columnSpan('full')

Timestamps

Outputs Created At and Updated At information blocks.

use FilamentAddons\Forms\Components\Timestamps;

Timestamps::make()

Separator

Just outputs a sensible hr to help separate components.

use FilamentAddons\Forms\Components\Separator;

Separator::make()

Heading

use FilamentAddons\Forms\Components\Heading;

Heading::make('whatevs')->level('h3')->content('This is a test')

Video Embed

video-embed

Allows embeded code with preview. This field does not sanitize your values. You are responsible for purifying any raw html input or output.

Supports most of the Textarea field's options.

use FilamentAddons\Forms\Fields\VideoEmbed;

VideoEmbed::make(string $fieldname)
    ->label('label')
    ->rows()

oEmbed

video-embed

Allows oembedding a video with preview.

Onlys supports YouTube and Vimeo at the moment.

use FilamentAddons\Forms\Components\OEmbed;

OEmbed::make(string $fieldname)

Tables

Title With Status Indicator

title with status

use FilamentAddons\Tables\Columns\TitleWithStatus;

TitleWithStatus::make(string $fieldname = 'title')
    ->statusField(string $fieldname = 'status') // optional
    ->statuses(array | Arrayable (Enum) Status::class)
    ->colors(array | Arrayable (Enum) Status::colors())
    ->hiddenOn(string | null Status::Published->name) //optional

filament-addons's People

Contributors

awcodes avatar wilfredchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.