tuto1902/infolist-carousel
Composer 安装命令:
composer require tuto1902/infolist-carousel
包简介
Infolist Carousel Entry for Filament v3
README 文档
README
Infolist Carousel entry that allows you to add a slide carousel to any of you Filament v3 projects.
Screenshots
Installation
You can install the package via composer:
composer require tuto1902/infolist-carousel
Add the following lines in the content section of your tailwind.config.js file
export default { presets: [preset], content: [ + './vendor/tuto1902/carousel/resources/**/*.blade.php', + './vendor/tuto1902/infolist-carousel/resources/**/*.blade.php', ], theme: { extend: {}, }, plugins: [], }
Optionally, you can publish the views using
php artisan vendor:publish --tag="infolist-carousel-views"
You can also publish the carousel blade components using
php artisan vendor:publish --tag="carousel-views"
Usage
Simply import the Carousel component and include it in your Infolist schema. The following is an example using a panel builder resource
use Tuto1902\InfolistCarousel\Infolists\Components\Carousel; use Filament\Infolists\Infolist; public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ Carousel::make('slides.file_name') ]); }
By default, the slides will display the column value (or the primary key of your model). You can provide your own slide view using:
public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ Carousel::make('slides.file_name') ->slideView('my-slide-template') ]); }
The view sould be created inside your project's resources/views folder. Here's an example of a simple square slide with an image background.
<div class="aspect-square bg-cover bg-center bg-no-repeat w-full h-full rounded-md" style="background-image: url('/{{ $state }}');" > <!-- // --> </div>
In this scenario, the $state variable points to the value of the slides.file_name column. If a column value is not provided, the $state variable will be Model instance. For example, imagine that you have a Carousel model (and it's corresponding Resource with an infolist page). Inside this model, you have a HasMany relationship with the Slide model. Therefore, you can get a list of all carousel slides using the ->slides property of the Carousel model class. If you only provide the relationship name to the Carousle::make method, the $state variable will be a Slide model instance. This way, you have access to all the information from Slide model inside your slide template.
public static function infolist(Infolist $infolist): Infolist { return $infolist ->schema([ Carousel::make('slides') ->slideView('my-slide-template') ]); }
<div class="..." style="background-image: url('/{{ $state->file_name }}');" > <!-- // --> </div>
Customization
You can customize the look and feel of your carousel usign the following options.
Loop
The carousel will loop back to the start/end of your slides.
Carousel::make('slides.file_name') ->loop()
Orientation
Change the orientation of the carousel. You can choose between Verical and Horizontal (default)
use Tuto1902\InfolistCarousel\Infolists\Components\Carousel\CarouselOrientation; Carousel::make('slides.file_name') ->orientation(CarouselOrientation::Vertical)
Size
Change the size of the carousel frame. You can choose between Small, Medium and Large. Additionally, you can provide any valid TailwindCSS size-* class as a string
use Tuto1902\InfolistCarousel\Infolists\Components\Carousel\CarouselSize; Carousel::make('slides.file_name') ->size(CarouselSize::Large) // or ->size('size-96')
Important
In order to provide TailwindCSS classes to the size function, you'll need to add the following line inside the content section of your tailwind.config.js file.
export default { presets: [preset], content: [ './vendor/tuto1902/carousel/resources/**/*.blade.php', './vendor/tuto1902/infolist-carousel/resources/**/*.blade.php', + './vendor/tuto1902/infolist-carousel/src/Infolists/Components/**/*.php', ], theme: { extend: {}, }, plugins: [], }
Autoplay & Delay
Slides will navigate automatically using the specified delay (in miliseconds). If no delay is provided, the default will be 4000 (4 seconds)
Carousel::make('slides.file_name') ->autoplay() ->delay(2000)
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
tuto1902/infolist-carousel 适用场景与选型建议
tuto1902/infolist-carousel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「Arturo Rojas」 「infolist-carousel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tuto1902/infolist-carousel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tuto1902/infolist-carousel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tuto1902/infolist-carousel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
Turn any PDF into a Pingen-ready A4 letter (generated address cover page + A4 normalisation + safe margins) and send it through the Pingen print & mail API. Laravel-first.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-11