Download the PHP package modularavel/favoritable without Composer

On this page you can find all versions of the php package modularavel/favoritable. 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 favoritable

modularavel/favoritable

A Laravel Livewire package that adds favorites functionality to your Laravel 11+ application. Allow users to favorite any model in your application with a beautiful, customizable UI.

Features

Requirements

Installation

Install the package via Composer:

Publish the migrations:

Run the migrations:

Optionally, publish the config file:

Optionally, publish the views for customization:

Setup

1. Add the Trait to Your Model

Add the Favoritable trait to any model you want users to be able to favorite:

2. Import CSS Styles

Add the package CSS to your main CSS file or import it in your layout:

Or include it directly in your Tailwind config:

Usage

Favorite Button Component

The simplest way to add a favorite button:

Button Variants

Choose from multiple button styles:

Button Sizes

Choose from three sizes:

Hide Counter

You can hide the favorites counter:

Favorites List Component

Display a paginated list of user's favorites:

Filter by Type

Show only favorites of a specific type:

Custom Pagination

Model Methods

The Favoritable trait adds several helpful methods to your models:

Customizing the Favorites List Display

To customize how your favorited items appear in the favorites list, implement these methods in your model:

Configuration

The package includes a configuration file with sensible defaults:

Events

The package dispatches Livewire events that you can listen to:

favoriteToggled

Dispatched when a favorite is toggled:

Testing

The package includes comprehensive Pest tests. To run tests:

Styling

The package uses Tailwind CSS for styling. All styles are scoped to avoid conflicts with your application. You can customize the appearance by:

  1. Publishing the views and modifying the Blade templates
  2. Overriding the CSS classes in your application's CSS
  3. Modifying the published CSS file

Advanced Usage

Custom Favorite Model

If you need to extend the Favorite model:

Middleware Protection

Protect your favorites routes with middleware:

License

MIT

Credits

Support

For issues, questions, or contributions, please visit the GitHub repository.


All versions of favoritable with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version >=8.0
illuminate/database Version >=8.0
livewire/livewire Version ^3.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 modularavel/favoritable contains the following files

Loading the files please wait ...