Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Frey <[email protected]>
  • Loading branch information
lukas-frey committed Dec 1, 2024
1 parent c30983d commit e4feb8d
Show file tree
Hide file tree
Showing 24 changed files with 305 additions and 470 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a
url: https://github.com/Guava/filament-icon-select-column/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas
url: https://github.com/Guava/filament-icon-select-column/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/:vendor_name/:package_name/security/policy
url: https://github.com/Guava/filament-icon-select-column/security/policy
about: Learn how to notify us for sensitive bugs
31 changes: 0 additions & 31 deletions .github/workflows/update-changelog.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
build
composer.lock
coverage
docs
phpunit.xml
phpstan.neon
testbench.yaml
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

All notable changes to `:package_name` will be documented in this file.
All notable changes to `filament-icon-select-column` will be documented in this file.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) :vendor_name <[email protected]>
Copyright (c) Guava <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
76 changes: 36 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
![:package_name Banner](docs/images/banner.jpg)
![Filament Icon Select Column Banner](https://github.com/GuavaCZ/filament-icon-select-column/raw/main/docs/images/banner.jpg)


# :package_description
# Adds a icon select (via dropdown) column to your filament tables.

[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
<!--delete-->
---
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
[![Latest Version on Packagist](https://img.shields.io/packagist/v/guava/filament-icon-select-column.svg?style=flat-square)](https://packagist.org/packages/guava/filament-icon-select-column)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/guavaCZ/filament-icon-select-column/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/guavaCZ/filament-icon-select-column/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/GuavaCZ/filament-icon-select-column/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/GuavaCZ/filament-icon-select-column/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/guava/filament-icon-select-column.svg?style=flat-square)](https://packagist.org/packages/guava/filament-icon-select-column)

1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
3. Have fun creating your package.
---
<!--/delete-->
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
This plugin adds an Icon Select Column to your filament tables.

## Showcase

This is where your screenshots and videos should go. Remember to add them, so people see what your plugin does.
<video width="320" height="240" controls>
<source src="https://github.com/GuavaCZ/filament-icon-select-column/raw/main/docs/images/demo_preview.mp4" type="video/mp4">
</video>

![Screenshot 1](https://github.com/GuavaCZ/filament-icon-select-column/raw/main/docs/images/screenshot_01.png)

## Support us

Expand All @@ -33,41 +29,41 @@ While our plugin is available for all to use, if you are utilizing it for commer
You can install the package via composer:

```bash
composer require :vendor_slug/:package_slug
composer require guava/filament-icon-select-column
```

You can publish and run the migrations with:

```bash
php artisan vendor:publish --tag=":package_slug-migrations"
php artisan migrate
```
## Usage

You can publish the config file with:
In any filament table, simply use it like any other column.

```bash
php artisan vendor:publish --tag=":package_slug-config"
```
The package works best in combination with backed enums, such as in the below example.

This is the contents of the published config file:
The enum should implement `HasLabel`, `HasIcon` and optionally `HasColor` as described in the filament documentation [here](https://filamentphp.com/docs/3.x/support/enums).

```php
return [
];
```

Optionally, you can publish the views using
use Guava\FilamentIconSelectColumn\Tables\Columns\IconSelectColumn;

```bash
php artisan vendor:publish --tag=":package_slug-views"
$table->columns([
IconSelectColumn::make('state')
->options(MyStateEnum::class)
]);
```

## Usage
Alternatively, you can pass an array of options and icons directly to the column:

```php
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
```
$table->columns([
IconSelectColumn::make('state')
->options([
'opt1' => 'Option 1',
'opt2' => 'Option 2',
])
->icons([
'opt1' => 'heroicon-o-check',
'opt2' => 'heroicon-o-x-mark',
])
]);
````

## Testing

Expand All @@ -89,7 +85,7 @@ Please review [our security policy](../../security/policy) on how to report secu

## Credits

- [:author_name](https://github.com/:author_username)
- [Lukas Frey](https://github.com/GuavaCZ)
- [All Contributors](../../contributors)
- Spatie - Our package skeleton is a modified version of [Spatie's Package Skeleton](https://github.com/spatie/package-skeleton-laravel)

Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": ":vendor_slug/:package_slug",
"description": ":package_description",
"name": "guava/filament-icon-select-column",
"description": "Adds a icon select (via dropdown) column to your filament tables.",
"keywords": [
":vendor_name",
"Guava",
"laravel",
":package_slug"
"filament-icon-select-column"
],
"homepage": "https://github.com/:vendor_slug/:package_slug",
"homepage": "https://github.com/GuavaCZ/filament-icon-select-column",
"license": "MIT",
"authors": [
{
"name": ":author_name",
"email": "[email protected]",
"name": "Lukas Frey",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"spatie/laravel-package-tools": "^1.14.0",
"illuminate/contracts": "^10.0|^11.0"
"filament/filament": "^3.2",
"illuminate/contracts": "^10.0|^11.0",
"spatie/laravel-package-tools": "^1.14.0"
},
"require-dev": {
"laravel/pint": "^1.0",
Expand All @@ -30,24 +31,23 @@
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"spatie/laravel-ray": "^1.26"
"phpstan/phpstan-phpunit": "^1.0"
},
"autoload": {
"psr-4": {
"VendorName\\Skeleton\\": "src/",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories/"
"Guava\\FilamentIconSelectColumn\\": "src/",
"Guava\\FilamentIconSelectColumn\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"VendorName\\Skeleton\\Tests\\": "tests/",
"Guava\\FilamentIconSelectColumn\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/"
}
},
"scripts": {
"post-autoload-dump": "@composer run prepare",
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"clear": "@php vendor/bin/testbench package:purge-filament-icon-select-column --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": [
"@composer run prepare",
Expand All @@ -73,10 +73,10 @@
"extra": {
"laravel": {
"providers": [
"VendorName\\Skeleton\\SkeletonServiceProvider"
"Guava\\FilamentIconSelectColumn\\FilamentIconSelectColumnServiceProvider"
],
"aliases": {
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
"FilamentIconSelectColumn": "Guava\\FilamentIconSelectColumn\\Facades\\FilamentIconSelectColumn"
}
}
},
Expand Down
6 changes: 0 additions & 6 deletions config/skeleton.php

This file was deleted.

Loading

0 comments on commit e4feb8d

Please sign in to comment.