PHPackages                             fluttersdk/magic-starter-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. fluttersdk/magic-starter-laravel

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

fluttersdk/magic-starter-laravel
================================

Magic Framework Laravel backend starter package.

0.0.4(3mo ago)1453↓90%MITPHPPHP ^8.2CI passing

Since Mar 24Pushed today1 watchersCompare

[ Source](https://github.com/fluttersdk/magic-starter-laravel)[ Packagist](https://packagist.org/packages/fluttersdk/magic-starter-laravel)[ Docs](https://magic.fluttersdk.com/starter)[ RSS](/packages/fluttersdk-magic-starter-laravel/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (11)Versions (7)Used By (0)

 [![Magic Logo](https://raw.githubusercontent.com/fluttersdk/magic/master/.github/magic-logo.svg)](https://raw.githubusercontent.com/fluttersdk/magic/master/.github/magic-logo.svg)

Magic Starter Laravel
=====================

[](#magic-starter-laravel)

 **Pre-built Auth, Profile, Teams &amp; Notifications API for Laravel.**
 12 opt-in features — every action overridable.

 [![Packagist Version](https://camo.githubusercontent.com/d5b237e6167956b865300711750170fa957541d20e0ea4085ef2bb625235b075/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c757474657273646b2f6d616769632d737461727465722d6c61726176656c2e737667)](https://packagist.org/packages/fluttersdk/magic-starter-laravel) [![CI Status](https://camo.githubusercontent.com/2cd9473b37f70a0c4c6aec9e5d83b563929791c630aab021abdfec0db33838c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f666c757474657273646b2f6d616769632d737461727465722d6c61726176656c2f63692e796d6c3f6272616e63683d6d6173746572266c6162656c3d4349)](https://github.com/fluttersdk/magic-starter-laravel/actions/workflows/ci.yml) [![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT) [![GitHub Stars](https://camo.githubusercontent.com/0b0c4f7042891c7020000442167e1f377e7f94a375a1a1a69691c719756d3136/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f666c757474657273646b2f6d616769632d737461727465722d6c61726176656c3f7374796c653d666c6174)](https://github.com/fluttersdk/magic-starter-laravel/stargazers)

 [Website](https://magic.fluttersdk.com/starter) · [Docs](https://magic.fluttersdk.com/packages/starter-laravel/getting-started/installation) · [Packagist](https://packagist.org/packages/fluttersdk/magic-starter-laravel) · [Issues](https://github.com/fluttersdk/magic-starter-laravel/issues) · [Discussions](https://github.com/fluttersdk/magic-starter-laravel/discussions)

---

> **Alpha** — `magic-starter-laravel` is under active development. APIs may change between minor versions until `1.0.0`.

---

Why Magic Starter Laravel?
--------------------------

[](#why-magic-starter-laravel)

Stop rebuilding authentication, profile management, and team features from scratch in every Laravel project. The same controllers, the same validation, the same service bindings — over and over.

**Magic Starter Laravel** gives you a production-ready JSON API for auth, profile, teams, and notifications out of the box. Everything is config-driven with 12 opt-in feature toggles. Every action is overridable via contract bindings — swap any business logic from your host app without touching the package.

> **Config-driven API starter kit.** Enable only what you need. Override any action. Ship faster.

---

Features
--------

[](#features)

FeatureDescription🔑**Authentication**Login, register, forgot/reset password, social login🛡️**Two-Factor Auth**Enable/disable 2FA with QR code, OTP confirm, recovery codes👤**Profile Management**Photo upload, email/password change, account deletion👥**Teams**Create, switch, invite members, manage roles, team photos🔔**Notifications**Listing, unread count, mark read/unread, preference matrix📱**OTP Login**Phone-based authentication with send/verify flow👻**Guest Auth**Guest-only login without a registered account✉️**Email Verification**Signed verification URL, resend notification📰**Newsletter**Subscribe/unsubscribe toggle per user🌐**Timezones**Timezone listing API for extended profile📷**Profile Photos**Upload and delete for users and teams🖥️**Sessions**Active session listing and revocation---

Quick Start
-----------

[](#quick-start)

### 1. Install the package

[](#1-install-the-package)

```
composer require fluttersdk/magic-starter-laravel
```

### 2. Run the install command

[](#2-run-the-install-command)

```
php artisan magic-starter:install
```

The `magic-starter:install` command guides you through setup interactively:

- Selects which of the 12 features to enable (all enabled by default)
- Detects your database primary key type (UUID or auto-incrementing integer)
- Publishes configuration and migrations in correct order
- Removes Laravel's default users migration to avoid conflicts
- Publishes model stubs, factory, and language files

The installer prompts to run `php artisan migrate` at the end (default: no). If you skip that prompt, run the migrations yourself before using the API, otherwise the published migrations stay unapplied:

```
php artisan migrate
```

Important

**Frontend URL:** The backend signs email links (verification, password reset, and other email links) using `APP_URL` as the base. If your email links should open a frontend whose host or scheme differs from `APP_URL`, set `MAGIC_STARTER_FRONTEND_URL` in your `.env` to the frontend base URL (the `magic-starter.frontend_url` config reads it), or pass `--frontend-url=https://app.example.com` when installing via `php artisan magic-starter:install`. Without it, email links point at the backend host (e.g. `https://api.example.com/email/verify/...`) instead of opening the intended frontend app.

**For CI/CD or non-interactive environments**, use command options:

```
# Install all features with UUID primary keys and custom route prefix
php artisan magic-starter:install --all --uuid --route-prefix=api/v2

# Install specific features, auto-detect primary key type
php artisan magic-starter:install --features=teams --features=profile-photos --features=notifications

# Install with integer primary keys instead of UUID
php artisan magic-starter:install --all --no-uuid

# Use custom frontend URL for email links
php artisan magic-starter:install --all --frontend-url=https://app.example.com

# Overwrite existing files (migrations, config, stubs)
php artisan magic-starter:install --all --force
```

Available options:

- `--all`: Enable all 12 features without prompting
- `--features=`: Enable specific feature(s); repeat for multiple (e.g. `--features=teams --features=sessions`)
- `--uuid`: Force UUID primary keys
- `--no-uuid`: Force auto-incrementing integer primary keys
- `--route-prefix=`: Set route prefix (default: `api/v1`)
- `--frontend-url=`: Frontend URL for email links (e.g. verification and password resets)
- `--force`: Overwrite existing published files

### 3. Prepare your User model

[](#3-prepare-your-user-model)

Add the required traits to your `User` model:

```
use FlutterSdk\MagicStarter\Traits\HasTeams;
use FlutterSdk\MagicStarter\Traits\HasGuestSupport;
use FlutterSdk\MagicStarter\Traits\HasProfilePhoto;
use FlutterSdk\MagicStarter\Traits\HasNotifications;
use FlutterSdk\MagicStarter\Support\ConditionallyUsesUuids;

class User extends Authenticatable
{
    use ConditionallyUsesUuids;
    use HasTeams;
    use HasGuestSupport;
    use HasProfilePhoto;
    use HasNotifications;
}
```

That's it — auth, profile, teams, and notifications API endpoints are ready to use.

---

Advanced: Manual Installation
-----------------------------

[](#advanced-manual-installation)

If you prefer to publish and migrate without the install command, you can run the steps manually. Note that manual `vendor:publish` does NOT generate ordered migration timestamps, so migrations may run in unpredictable order and cause foreign key conflicts. The `magic-starter:install` command is the recommended path because it ensures correct migration order.

If you must use manual steps:

```
php artisan vendor:publish --provider="FlutterSdk\MagicStarter\MagicStarterServiceProvider" --tag=magic-starter-config
php artisan migrate
```

You will also need to:

1. Remove Laravel's default `database/migrations/0001_01_01_000000_create_users_table.php` if it conflicts
2. Manually publish migrations from the package at `src/../database/migrations/` to `database/migrations/` with ordered `Y_m_d_NNNNNN_` prefixes
3. Apply the traits listed in Step 3 above to your User model

---

Feature Toggles
---------------

[](#feature-toggles)

All 12 features are opt-in. Enable them by uncommenting in `config/magic-starter.php`:

Toggle KeyDescription`teams`Team creation, switching, member invitations, role management`profile-photos`Profile photo upload and display for users and teams`sessions`Active session listing and revocation`social-login`Social authentication via Socialite providers`newsletter-subscription`Newsletter subscribe/unsubscribe toggle`extended-profile`Extended profile fields: phone, timezone, language, locale`notifications`Notification listing, unread count, read/unread, preferences`two-factor-authentication`Two-factor auth with QR code, OTP confirmation, recovery codes`email-verification`Signed email verification URL and resend notification`guest-auth`Guest-only authentication without a registered account`phone-otp`Phone-based OTP send/verify login flow`timezones`Timezone listing API endpoint---

Architecture
------------

[](#architecture)

```
Request → Route (feature-gated, rate-limited)
  → Controller (thin — injects contract)
    → Contract interface
      → Action (business logic, validator, model resolution)
        → Model (ConditionallyUsesUuids, dynamic resolution)

```

**Key patterns:**

PatternImplementationContract-ActionControllers inject interfaces from `Contracts/`, bound in ServiceProviderFeature Toggles`Features::enabled()` gates routes, logic, and resource fieldsDynamic Model Resolution`MagicStarter::userModel()`, `::teamModel()` — never hardcode classesService ProviderContract bindings, route registration, rate limiters, password reset URLRate LimitersPer-endpoint throttle groups: auth, register, social, 2FA, OTP, etc.---

Documentation
-------------

[](#documentation)

DocumentDescription[Installation](https://magic.fluttersdk.com/packages/starter-laravel/getting-started/installation)Adding the package, publishing config, running migrations[Configuration](https://magic.fluttersdk.com/packages/starter-laravel/getting-started/configuration)Config file reference and feature toggles[Authentication](https://magic.fluttersdk.com/packages/starter-laravel/basics/authentication)Login, register, forgot/reset password, social login, OTP[Teams](https://magic.fluttersdk.com/packages/starter-laravel/basics/teams)Team CRUD, switching, invitations, member roles[Profile](https://magic.fluttersdk.com/packages/starter-laravel/basics/profile)Profile updates, photo upload, password change, account deletion[Two-Factor Auth](https://magic.fluttersdk.com/packages/starter-laravel/basics/two-factor-auth)2FA enable/disable, QR code, confirm, recovery codes[Notifications](https://magic.fluttersdk.com/packages/starter-laravel/basics/notifications)Listing, unread count, mark read, preferences[Service Provider](https://magic.fluttersdk.com/packages/starter-laravel/architecture/service-provider)Contract bindings, route registration, rate limiters[Action Contracts](https://magic.fluttersdk.com/packages/starter-laravel/architecture/action-contracts)Overriding business logic via singleton binding[Models](https://magic.fluttersdk.com/packages/starter-laravel/architecture/models)Dynamic resolution, UUID support, traits---

Contributing
------------

[](#contributing)

Contributions are welcome! Please see the [issues page](https://github.com/fluttersdk/magic-starter-laravel/issues) for open tasks or to report bugs.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Write tests following the TDD flow — red, green, refactor
4. Ensure all checks pass: `composer test`, `composer lint`, `composer analyse`
5. Submit a pull request

---

License
-------

[](#license)

Magic Starter Laravel is open-sourced software licensed under the [MIT License](LICENSE).

---

 Built with care by [FlutterSDK](https://github.com/fluttersdk)
 If Magic Starter Laravel helps your project, consider giving it a [star on GitHub](https://github.com/fluttersdk/magic-starter-laravel).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance92

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

93d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21953173?v=4)[Anılcan Çakır](/maintainers/anilcancakir)[@anilcancakir](https://github.com/anilcancakir)

---

Top Contributors

[![anilcancakir](https://avatars.githubusercontent.com/u/21953173?v=4)](https://github.com/anilcancakir "anilcancakir (128 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

---

Tags

laravelauthsanctumprofilestarterjetstreamTeams

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/fluttersdk-magic-starter-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/fluttersdk-magic-starter-laravel/health.svg)](https://phpackages.com/packages/fluttersdk-magic-starter-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6753.6k5](/packages/hasinhayder-tyro)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2453.7k5](/packages/hasinhayder-tyro-login)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
