-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f62ae8c
Showing
21 changed files
with
527 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
All notable changes to `filament-product` will be documented in this file. | ||
|
||
## 1.0.0 - 202X-XX-XX | ||
|
||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) red-jasmine <liushoukun66@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# This is my package filament-product | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/red-jasmine/filament-product.svg?style=flat-square)](https://packagist.org/packages/red-jasmine/filament-product) | ||
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/red-jasmine/filament-product/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/red-jasmine/filament-product/actions?query=workflow%3Arun-tests+branch%3Amain) | ||
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/red-jasmine/filament-product/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/red-jasmine/filament-product/actions?query=workflow%3A"Fix+PHP+code+styling"+branch%3Amain) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/red-jasmine/filament-product.svg?style=flat-square)](https://packagist.org/packages/red-jasmine/filament-product) | ||
|
||
|
||
|
||
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. | ||
|
||
## Installation | ||
|
||
You can install the package via composer: | ||
|
||
```bash | ||
composer require red-jasmine/filament-product | ||
``` | ||
|
||
You can publish and run the migrations with: | ||
|
||
```bash | ||
php artisan vendor:publish --tag="filament-product-migrations" | ||
php artisan migrate | ||
``` | ||
|
||
You can publish the config file with: | ||
|
||
```bash | ||
php artisan vendor:publish --tag="filament-product-config" | ||
``` | ||
|
||
Optionally, you can publish the views using | ||
|
||
```bash | ||
php artisan vendor:publish --tag="filament-product-views" | ||
``` | ||
|
||
This is the contents of the published config file: | ||
|
||
```php | ||
return [ | ||
]; | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
$filamentProduct = new Redjasmine\FilamentProduct(); | ||
echo $filamentProduct->echoPhrase('Hello, Redjasmine!'); | ||
``` | ||
|
||
## Testing | ||
|
||
```bash | ||
composer test | ||
``` | ||
|
||
## Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. | ||
|
||
## Security Vulnerabilities | ||
|
||
Please review [our security policy](../../security/policy) on how to report security vulnerabilities. | ||
|
||
## Credits | ||
|
||
- [liushoukun](https://github.com/red-jasmine) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import esbuild from 'esbuild' | ||
|
||
const isDev = process.argv.includes('--dev') | ||
|
||
async function compile(options) { | ||
const context = await esbuild.context(options) | ||
|
||
if (isDev) { | ||
await context.watch() | ||
} else { | ||
await context.rebuild() | ||
await context.dispose() | ||
} | ||
} | ||
|
||
const defaultOptions = { | ||
define: { | ||
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`, | ||
}, | ||
bundle: true, | ||
mainFields: ['module', 'main'], | ||
platform: 'neutral', | ||
sourcemap: isDev ? 'inline' : false, | ||
sourcesContent: isDev, | ||
treeShaking: true, | ||
target: ['es2020'], | ||
minify: !isDev, | ||
plugins: [{ | ||
name: 'watchPlugin', | ||
setup: function (build) { | ||
build.onStart(() => { | ||
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`) | ||
}) | ||
|
||
build.onEnd((result) => { | ||
if (result.errors.length > 0) { | ||
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors) | ||
} else { | ||
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`) | ||
} | ||
}) | ||
} | ||
}], | ||
} | ||
|
||
compile({ | ||
...defaultOptions, | ||
entryPoints: ['./resources/js/index.js'], | ||
outfile: './resources/dist/filament-product.js', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"name": "red-jasmine/filament-product", | ||
"description": "This is my package filament-product", | ||
"keywords": [ | ||
"red-jasmine", | ||
"laravel", | ||
"filament-product" | ||
], | ||
"homepage": "https://github.com/red-jasmine/filament-product", | ||
"support": { | ||
"issues": "https://github.com/red-jasmine/filament-product/issues", | ||
"source": "https://github.com/red-jasmine/filament-product" | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "liushoukun", | ||
"email": "liushoukun66@gmail.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"filament/filament": "^3.0", | ||
"spatie/laravel-package-tools": "^1.15.0" | ||
}, | ||
"require-dev": { | ||
"nunomaduro/collision": "^7.9", | ||
"orchestra/testbench": "^8.0", | ||
"pestphp/pest": "^2.1", | ||
"pestphp/pest-plugin-arch": "^2.0", | ||
"pestphp/pest-plugin-laravel": "^2.0", | ||
"spatie/laravel-ray": "^1.26" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Redjasmine\\FilamentProduct\\": "src/", | ||
"Redjasmine\\FilamentProduct\\Database\\Factories\\": "database/factories/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Redjasmine\\FilamentProduct\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi", | ||
"test": "vendor/bin/pest", | ||
"test-coverage": "vendor/bin/pest --coverage" | ||
}, | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"pestphp/pest-plugin": true, | ||
"phpstan/extension-installer": true | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Redjasmine\\FilamentProduct\\FilamentProductServiceProvider" | ||
], | ||
"aliases": { | ||
"FilamentProduct": "Redjasmine\\FilamentProduct\\Facades\\FilamentProduct" | ||
} | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
// config for Redjasmine/FilamentProduct | ||
return [ | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Redjasmine\FilamentProduct\Database\Factories; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/* | ||
class ModelFactory extends Factory | ||
{ | ||
protected $model = YourModel::class; | ||
public function definition() | ||
{ | ||
return [ | ||
]; | ||
} | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::create('filament_product_table', function (Blueprint $table) { | ||
$table->id(); | ||
|
||
// add fields | ||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
plugins: { | ||
"postcss-import": {}, | ||
"tailwindcss/nesting": {}, | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import '../../vendor/filament/filament/resources/css/theme.css'; |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
// translations for Redjasmine/FilamentProduct | ||
return [ | ||
// | ||
]; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Redjasmine\FilamentProduct\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class FilamentProductCommand extends Command | ||
{ | ||
public $signature = 'filament-product'; | ||
|
||
public $description = 'My command'; | ||
|
||
public function handle(): int | ||
{ | ||
$this->comment('All done'); | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Redjasmine\FilamentProduct\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @see \Redjasmine\FilamentProduct\FilamentProduct | ||
*/ | ||
class FilamentProduct extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return \Redjasmine\FilamentProduct\FilamentProduct::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace Redjasmine\FilamentProduct; | ||
|
||
class FilamentProduct {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Redjasmine\FilamentProduct; | ||
|
||
use Filament\Contracts\Plugin; | ||
use Filament\Panel; | ||
|
||
class FilamentProductPlugin implements Plugin | ||
{ | ||
public function getId(): string | ||
{ | ||
return 'filament-product'; | ||
} | ||
|
||
public function register(Panel $panel): void | ||
{ | ||
// | ||
} | ||
|
||
public function boot(Panel $panel): void | ||
{ | ||
// | ||
} | ||
|
||
public static function make(): static | ||
{ | ||
return app(static::class); | ||
} | ||
|
||
public static function get(): static | ||
{ | ||
/** @var static $plugin */ | ||
$plugin = filament(app(static::class)->getId()); | ||
|
||
return $plugin; | ||
} | ||
} |
Oops, something went wrong.