Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sharp Laravel Package

code16/sharp

Code-driven CMS framework for Laravel (PHP 8.3+/Laravel 11+). Build admin/CMS sections with a clean UI and strong DX: CRUD with validation, search/sort/filter, bulk or custom commands, and authorization—no front-end code required, data-agnostic.

View on GitHub
Deep Wiki
Context7

List

Class: Code16\Sharp\Show\Fields\SharpShowListField

This field is very similar to the Form's File field, and its purpose is to display items made of other Show fields.

Here's an example, for a list of pictures with a legend:

class MyShow extend SharpShow
{
    // [...]
    function buildShowLayout(ShowLayout $showLayout): void
    {
        $showLayout->addField(
            SharpShowListField::make('pictures')
                ->setLabel('additional pictures')
                ->addItemField(
                    SharpShowFileField::make('file')
                        ->setStorageDisk('local')
                        ->setStorageBasePath('data/Product/{id}/pictures')
                )
                ->addItemField(
                    SharpShowTextField::make('legend')
                        ->setLabel('Legend')
                )
        );
    }
}

Configuration

setLabel()

Set the field label.

addItemField(SharpShowField $field)

Add a SharpShowField in the item.

Layout

The List item layout must be defined like the show itself, in the buildShowLayout() function. The item layout is managed as a column, with a ShowLayoutColumn object. To link the column and the item, use the classic withField() function with a second argument, a Closure accepting a ShowLayoutColumn.

Example:

class MyShow extend SharpShow
{
    // [...]
    function buildShowLayout(ShowLayout $showLayout): void
    {
        $showLayout->addColumn(6, function (ShowLayoutColumn $column) {
             $column->withListField('pieces', function (ShowLayoutColumn $listItem) {
                  $listItem->withField('acquisition_date')
                      ->withField('title')
                      ->withField('artist');
             });
         });
    }
}

Formatter

The Formatter expects an array or a Collection of models, each one defining attributes for each list item keys at the format expected by the corresponding Field Formatter.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope