namratalohani / filament-hr-system
HR System made with laravel, filament and livewire
Requires
- php: ^8.0
- filament/filament: ^3.2
- illuminate/contracts: ^10.0||^11.0
- illuminate/support: ^10.0||^11.0
Requires (Dev)
- orchestra/testbench: ^9.0.0
- phpunit/phpunit: ^10.0
README
Filament HR System is a Laravel package designed to streamline HR management tasks. It integrates seamlessly with Laravel, Livewire, and Filament to provide prebuilt widgets, migrations, and customizable assets.
Features
- Attendance management widgets.
- Prebuilt Blade views.
- Easy migration setup.
- Customizable Tailwind CSS assets.
- Fully compatible with Filament.
Installation
To install the package, follow these steps:
-
Add the package to your project using Composer:
composer require namratalohani/filament-hr-system
-
Publish the package assets and configuration:
php artisan vendor:publish --tag=config
This creates a configuration file in your project:
config/filament-hr-system.php
.
Setting Up the Package
Step 1: Publish Migrations
To add the package's migrations to your project, run:
php artisan vendor:publish --tag=migrations
Then apply the migrations to your database:
php artisan migrate
Step 2: Publish Blade Views
If you want to customize the Blade views provided by the package, publish them using:
php artisan vendor:publish --tag=views
This will copy the views to resources/views/vendor/filament-hr-system
.
Step 3: Update Tailwind CSS Configuration
To ensure the package's Blade files are processed correctly by Tailwind CSS, you need to update your tailwind.config.js
file.
-
Add the following path to the
content
section in your main Tailwind configuration file:module.exports = { content: [ "./resources/**/*.blade.php", "./vendor/namratalohani/**/*.blade.php", // other paths... ], theme: { extend: {}, }, plugins: [], };
-
If you are using Filament, update Filament's Tailwind configuration file (usually located at
filament/admin/tailwind.config.js
):module.exports = { content: [ "./resources/**/*.blade.php", "./vendor/filament/**/*.blade.php", "./vendor/namratalohani/**/*.blade.php", // other paths... ], theme: { extend: {}, }, plugins: [], };
-
Rebuild your frontend assets:
npm run build
Step 4: Register the Widget
To register the AttendanceWidget
in your Filament admin panel, modify your AdminPanelProvider
:
-
Locate your
AdminPanelProvider
file, usually inapp/Providers/Filament/AdminPanelProvider.php
. -
Add the
AttendanceWidget
to thewidgets
section:use Namratalohani\FilamentHrSystem\Filament\Widgets\AttendanceWidget; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel ->default() ->id('admin') ->path('admin') ->login() ->viteTheme('resources/css/filament/admin/theme.css') ->widgets([ AttendanceWidget::class, ]); } }
-
Save the changes, and your widget will now be available in the Filament admin panel.
Customization
Step 1: Customize Assets
If you need to customize the package's CSS or JS, you can publish the assets:
php artisan vendor:publish --tag=assets
The assets will be copied to the public/vendor/filament-hr-system
directory. Modify them as needed.
Example Project Setup
If you’re cloning the repository:
-
Clone the repository:
git clone https://github.com/namratalohani/filament-hr-system.git
-
Navigate to the package directory:
cd filament-hr-system
-
Install dependencies:
composer install
-
Follow the installation steps above to configure the package.
Troubleshooting
Issue: "No publishable resources for tag"
If you encounter an error like:
No publishable resources for tag [tag-name].
Ensure the package service provider is properly registered in your Laravel project. Check config/app.php
or verify that the extra
section in your composer.json
includes:
"extra": { "laravel": { "providers": [ "Namratalohani\\FilamentHrSystem\\FilamentHrSystemServiceProvider" ] } }
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
License
This package is open-sourced software licensed under the MIT license.