Skip to content

Installation

This guide takes you from an empty Laravel app to a working Tashil install. It takes about five minutes, and each step explains why you're doing it so nothing feels like magic.

Requirements

Before you start, make sure your project meets these:

  • PHP 8.2 – 8.5
  • Laravel 10.x, 11.x, 12.x, or 13.x
  • Redis — optional, only needed if you enable the caching layer
LaravelPHPReleased
10.x8.2 / 8.3Feb 2023
11.x8.2 / 8.3 / 8.4Mar 2024
12.x8.2 – 8.5Feb 2025
13.x8.3 / 8.4 / 8.5Mar 2026

Step 1 — Install via Composer

composer require foysal50x/tashil

Tashil uses Laravel's package auto-discovery, so the service provider registers itself — there's nothing to add to config/app.php.

Installing the beta

While Tashil is in beta, ask Composer for the pre-release explicitly, or set your project's minimum-stability to beta:

composer require foysal50x/tashil:^1.0.0-beta

Step 2 — Publish the configuration

Publish config/tashil.php so you can tune the package to your app:

php artisan vendor:publish --tag=tashil-config

You can skip this for now and accept the defaults — every option is documented in Configuration.

Step 3 — Publish and run the migration

Tashil ships a single migration that creates all of its tables (prefixed tashil_ by default):

php artisan vendor:publish --tag=tashil-migrations
php artisan migrate

This creates the plan catalog, subscriptions, feature snapshots, usage counters, the event log, invoices, and transactions. See Database Schema for the full table list.

Step 4 — Make your model Subscribable

A subscriber is any Eloquent model that can hold a subscription — usually your User, but it can just as easily be a Team, Organization, or tenant model.

To make a model subscribable, implement the Subscribable contract and use the HasSubscriptions trait:

app/Models/User.php
use Foysal50x\Tashil\Contracts\Subscribable;
use Foysal50x\Tashil\Traits\HasSubscriptions;
use Illuminate\Foundation\Auth\User as Authenticatable;
 
class User extends Authenticatable implements Subscribable
{
    use HasSubscriptions;
}

implements Subscribable is required

Every type-hint in Tashil accepts the Subscribable interface, never Eloquent's Model. The HasSubscriptions trait provides default implementations for all four interface methods, but you must add implements Subscribable or the type-hints won't accept your model.

That single line unlocks the full subscriber API — subscribe(), useFeature(), subscribed(), and more. See Subscriptions for the complete surface.

Step 5 — Wire the scheduler

Tashil ships seven scheduled commands that handle unattended transitions — renewing subscriptions, expiring trials, resetting quotas, and processing dunning. By default they auto-register with Laravel's scheduler, so there's nothing to do as long as your app's scheduler is running.

Make sure your server runs Laravel's scheduler once a minute (you almost certainly already do this):

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Verify the commands are registered:

php artisan schedule:list

You should see all seven tashil:* commands. If you'd rather wire them yourself, see Scheduler & Jobs.

Step 6 (optional) — Enable caching

Tashil can cache the cold catalog (plans and features) and analytics aggregates on a dedicated Redis store, isolated from your app's main cache. It's enabled by default but only used when Redis is reachable. Configure it with environment variables:

.env
TASHIL_CACHE_ENABLED=true
TASHIL_REDIS_HOST=127.0.0.1
TASHIL_REDIS_PORT=6379
TASHIL_REDIS_DB=5

To turn caching off entirely (handy in local development):

.env
TASHIL_CACHE_ENABLED=false

Read more in Configuration.

You're ready

That's it — Tashil is installed and wired. Continue to the Quick Start to build your first plan, subscribe a user, and gate a feature end to end.

Tashil — Subscription management for Laravel. Released under the MIT license.