Skip to content
Türkçe

Introducing Magic Starter Laravel 1.0.3

Ship the app backend without the controllers.

The Laravel backend of Magic Starter: sign-in, two-factor, teams, notifications and billing as Sanctum-token JSON routes. Each feature is a toggle and each action can be replaced.

Runs on

  • PHP 8.2+
  • Laravel 12.32+
  • Laravel 13

The API behind your app, already built.

Sign-in, teams, notifications and billing ship as JSON routes behind feature toggles. Turn on what the app needs and replace any action with your own.

Sign-in, every way

Login and registration answer with a Sanctum token and the user, by email, by phone or both. Social, guest and phone OTP sign-in sit behind feature toggles.

  • two-factor-authentication adds TOTP with a QR code, recovery codes and the sign-in challenge
  • Phone OTP ships a LogOtpProvider that only writes to the log: bind SendsOtpCodes first
Read the docs

Teams and invitations

Create teams, invite by email, change member roles and switch the current team. With restorable-teams a deleted team can be restored for a window.

  • With teams picked, the installer publishes the Team, TeamUser and TeamInvitation models and a TeamPolicy
  • Schedule magic-starter:purge-trashed-teams yourself: the package registers it and does not schedule it
Read the docs

Subscriptions on two rails

Stripe through Laravel Cashier and the App Store or Google Play through RevenueCat, kept as one entitlement on the user or the team.

  • Never publish cashier-migrations: they target users with integer keys whatever billing.billable says
  • billing:manifest prints what the vendors must hold and billing:doctor checks it
Read the docs

Notifications and push

Database notifications with an unread count and a per-type, per-channel preference matrix. With onesignal on, push goes through OneSignal.

  • OneSignal accepts a mismatched external id and delivers to nobody: keep the prefix equal to the client's
  • Mail moves to OneSignal one mail class at a time, through a router transport
Read the docs

An optional admin panel on Filament

magic-starter:filament:install adds a panel with resources for users, teams, billing, audits, releases and support, each shown only while its feature is on.

  • List staff in MAGIC_STARTER_ADMIN_EMAILS: an empty list admits nobody
  • Every write goes through the same action contract the API calls
Read the docs
use Filament\Models\Contracts\FilamentUser;
use AnilcanCakir\MagicStarter\Filament\Concerns\AuthorizesAdminPanel;

class User extends Authenticatable implements FilamentUser
{
    use AuthorizesAdminPanel;
}

Every action replaceable

Controllers stay thin and inject a contract from Contracts\. Bind your own class and the API and the admin panel both change.

  • vendor:publish --tag=magic-starter-stubs copies skeletons that throw until you implement them
  • Models resolve at runtime through MagicStarter::userModel(), teamModel() and billableModel()
Read the docs
// app/Providers/AppServiceProvider.php
use AnilcanCakir\MagicStarter\Contracts\CreatesUsers;
use App\Actions\MagicStarter\CreateUser; // your class

public function register(): void
{
    $this->app->bind(CreatesUsers::class, CreateUser::class);
}
commands to install
3
API tokens
Sanctum
license
MIT

Questions, answered.

What people ask before they add Magic Starter Laravel to a Laravel app.

What is Magic Starter Laravel?

Magic Starter Laravel is a Laravel package that serves authentication, two-factor, social sign-in, profile, teams, notifications, billing and a support desk as Sanctum-token JSON routes. It is the backend of the Flutter starter magic_starter.

How do I install Magic Starter Laravel?

Run composer require anilcancakir/magic-starter-laravel, then php artisan magic-starter:install and php artisan migrate. The installer asks which features to enable, picks UUID or integer keys from your users table and publishes the config, the migrations and a User model.

What does Magic Starter Laravel require?

PHP 8.2 or later with ext-gd and ext-exif, and Laravel 12.32 or later, or Laravel 13. The optional admin panel needs Filament ^4.13.3 or ^5.8.3.

Do I need the Flutter app to use it?

The package does not depend on it: the routes are JSON over Sanctum tokens. magic_starter is the Flutter client that calls them one to one, so a route changed here should change there too.

How do I turn a feature on?

Add its key to the features array of config/magic-starter.php, or choose it in magic-starter:install. A feature that is off registers none of its routes, commands or scheduled tasks, so its endpoints answer 404.

Can I change what a route does?

Yes. Controllers inject a contract from Contracts\, and the service provider binds each one to a default under Actions\. Bind your own class to the contract in AppServiceProvider::register() and the API and the admin panel both use it.

Does Magic Starter Laravel work with AI coding agents?

Yes. Laravel Boost installs the magic-starter-development skill the package ships, and its docs are available as llms.txt and over MCP.

Is Magic Starter Laravel open source?

Yes. Magic Starter Laravel is open source under the MIT license.

Add it in seconds

~/my_app
composer require anilcancakir/magic-starter-laravel

Then run php artisan magic-starter:install and php artisan migrate. Or add it to composer.json:

{
    "require": {
        "anilcancakir/magic-starter-laravel": "^1.0.3"
    }
}

Or give your AI agent this prompt:

Read https://anilcancakir.com/magic-starter-laravel/docs/llms.txt and install the Magic Starter Laravel package in this project.