buzkall/finisterre

Helper package

Installs: 170

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/buzkall/finisterre


README

My helper package

Installation

You can install the package via composer:

composer require buzkall/finisterre

You can publish the config file with:

php artisan vendor:publish --tag="finisterre-config"

By default, the package will not be active, this can be changed adding the following to your .env file

FINISTERRE_ACTIVE=true

You can change the name of the table in the config file You can publish and run the migrations with:

php artisan vendor:publish --tag="finisterre-migrations"
php artisan migrate

If you don't already have the spatie tags package, publish the migrations

php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="tags-migrations"
php artisan migrate

Optionally, you can publish the views using

php artisan vendor:publish --tag="finisterre-views"

You can publish the assets (CSS) with:

php artisan filament:assets

The package comes with a default policy for the tasks, that can be overridden in the config file and set your own policy

'model_policy' => Buzkall\Finisterre\Policies\FinisterreTaskPolicy::class,

Usage

Add the plugin to your panel provider and specify the permissions

use Buzkall\Finisterre\FinisterrePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FinisterrePlugin::make()
                ->userCanViewAllTasks(fn() => auth()->user()?->hasRole(RoleEnum::Admin))
                ->userCanViewOnlyTheirTasks(fn() => auth()->user()?->hasAnyRole([RoleEnum::Editor, RoleEnum::Manager])),
        ])
    ])
}

SMS notifications

Using smsarena.es as provider. By default, only notifies tasks on creation with priority TaskPriorityEnum::Urgent That can be changed in the config file

Add to your .env file the following:

# Finisterre
FINISTERRE_SMS_ENABLED=false
FINISTERRE_SMS_AUTH_KEY=CHANGE
FINISTERRE_SMS_SENDER=CHANGE
FINISTERRE_SMS_NOTIFY_TO=CHANGE

Role restriction for Task Reports

TODO

Development

To build the CSS assets after making changes to Tailwind classes:

npm run build:styles

Testing

composer test