Download the PHP package tadasei/backend-trashable-notifications without Composer

On this page you can find all versions of the php package tadasei/backend-trashable-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package backend-trashable-notifications

Tadasei/backend-trashable-notifications

This package provides stubs for managing trashable (soft deletable) database notifications in the backend of a Laravel application. It simplifies common Index, Store, Update, and Delete notification operations by providing pre-defined structures.

Features

Installation

Install the package via Composer by running:

Usage

Publishing Trashable Notifications Management Utilities

To publish the utilities, including the supervisord configuration files, run:

This command generates all necessary files, including:

Configuration

After publishing the utilities, follow these steps to complete the configuration:

  1. Form Request Configuration: Modify the generated form request (App\Http\Requests\SendNotificationRequest) to suit your application's validation rules and logic.

  2. Policy Configuration: Update the generated policy (App\Policies\DatabaseNotificationPolicy) to control access to notification management operations, ensuring it aligns with your project's authorization system.

  3. Notifiable Trait Replacement: The package provides a custom Notifiable trait, which will be published along with the other management utilities. You must replace the built-in Laravel Notifiable trait with this one in your desired notifiable models. For example:

    This ensures that your models properly handle trashable notifications.

  4. Routes Registration: The routes/resources/notification.php file is generated as part of the management utilities. You must register this file in your application's built-in routes/web.php or routes/api.php to make the package routes available. For example, in routes/api.php:

    The generated routes are protected by the auth:sanctum middleware by default. If your project uses a different authentication guard, you may need to update the middleware to fit your authentication system.

  5. Running the Migration: The package generates a migration as part of the utilities. You need to run this migration to set up the necessary database structure for managing trashable notifications. Use the following Artisan command:

These steps are necessary to ensure that the package integrates smoothly with your application's existing structure.

Using Supervisord Configuration Files in Production

The supervisord configuration files, generated by the php artisan trashable-notifications:install command, are essential for managing queues in production.

  1. Copy the Configuration Files:
    Move the generated .conf files to the /etc/supervisor/conf.d directory in your production server. This allows supervisord to pick up the configuration and manage your processes as defined in the files.

  2. Learn More About Supervisor:
    For further details on how to configure and manage Laravel queues with Supervisor, refer to the Laravel documentation on Supervisor configuration.

Managing Log Files in Production

When using the package in production, log files generated by the supervisord configuration files must be excluded from source control to prevent unnecessary clutter in your versioning system.

Each generated supervisord configuration file has a name format:

To exclude the associated log files, perform the following steps:

  1. Transform the Configuration File Name:
    Remove the <app_name_in_lower_snake>_ prefix and replace the .conf extension with .log, adding an asterisk (*) at the end. For example:

    • If the configuration file is my_app_worker.conf, the corresponding log file would be worker*.log.
  2. Update Your .gitignore:
    Add the transformed file name to your .gitignore file. For the above example, your .gitignore entry would look like this:

This ensures that log files generated in production do not get included in your source control repository.

Further Customization

The generated code serves as a starting point. You can further extend and customize it to fit your project’s needs.

Contributing

Contributions are welcome! If you have suggestions, bug reports, or feature requests, please open an issue on the GitHub repository.

License

This package is open-source software licensed under the MIT license.


All versions of backend-trashable-notifications with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
illuminate/console Version ^9.0|^10.0|^11.0
illuminate/filesystem Version ^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/validation Version ^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tadasei/backend-trashable-notifications contains the following files

Loading the files please wait ....