A beautiful, modern Laravel theme package for API Developer Portals with built-in authentication, product management, and multi-language support.
✨ Auto-Registration - Works out of the box after installation
🎨 Customizable - Publish only what you need to customize
🌍 Multi-language - Built-in English and Arabic translations
🔐 Authentication - Complete auth system with login, register, and password reset
📦 API Products - Product catalog with Swagger documentation viewer
👤 User Dashboard - App management and API key generation
🌙 Dark Mode - Optional dark mode support
🎯 Laravel Conventions - Follows standard Laravel package patterns
composer require ninjaportal/shadow-theme
php artisan shadow:install
npm install && npm run buildThat's it! The theme is now active and working.
If you want to customize specific parts:
# Install with specific components
php artisan shadow:install --views --config
# Or install everything
php artisan shadow:install --all
# Available options:
# --views Publish views for customization
# --config Publish configuration file
# --frontend Publish JS/CSS files
# --lang Publish language files
# --tailwind Publish Tailwind configuration
# --all Publish everything
# --force Overwrite existing filesThe package uses Laravel's auto-discovery feature. Once installed via Composer:
- Service Provider is automatically registered
- Routes are automatically loaded (customizable via config)
- Views are loaded from package (overridable)
- Translations are loaded from package (extendable)
- Assets are served from
public/vendor/shadow/
Laravel loads views in this order:
resources/views/vendor/shadow/(if you published views)- Package views (fallback)
This means you can override any view by publishing and modifying it!
Add these to your .env file:
# Shadow Theme Configuration
SHADOW_DEFAULT_THEME=default # or 'dark'
SHADOW_DARKMODE_ENABLED=false
# ReCaptcha (optional)
RECAPTCHA_ENABLED=false
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET=
# App Keys Configuration
KEYS_PER_APP=2
# Routes (optional)
SHADOW_ROUTES_ENABLED=true
SHADOW_ROUTES_PREFIX=
SHADOW_ROUTES_DOMAIN=Publish the config file for more control:
php artisan vendor:publish --tag=shadow-configThen edit config/shadow.php:
return [
'default_theme' => 'default',
'darkmode_enabled' => false,
'locales' => [
'en' => 'English',
'ar' => 'العربية',
],
'routes' => [
'enabled' => true,
'prefix' => '',
'middleware' => ['web', 'set-locale'],
'domain' => null,
],
];Publish views to modify them:
php artisan vendor:publish --tag=shadow-viewsViews will be published to resources/views/vendor/shadow/. Modify any view and it will override the package version.
php artisan vendor:publish --tag=shadow-langTranslations will be published to lang/vendor/shadow/. Add new languages or modify existing ones.
php artisan vendor:publish --tag=shadow-frontendThis publishes JS and CSS files to resources/js/vendor/shadow/ and resources/css/vendor/shadow/.
php artisan vendor:publish --tag=shadow-tailwindThis publishes tailwind.shadow.config.js for complete theme customization.
The package registers the following routes:
GET /- Home pageGET /products- Product listingGET /products/{id}- Product detailsGET /auth/login- Login pagePOST /auth/login- Login actionGET /auth/register- Register pagePOST /auth/register- Register actionGET /auth/forgot-password- Password reset requestPOST /auth/forgot-password- Send reset linkGET /auth/reset-password/{token}- Password reset formPOST /auth/reset-password- Reset password action
GET /apps- User apps listingGET /apps/create- Create app formPOST /apps/create- Store appGET /apps/{id}- App detailsGET /apps/{id}/edit- Edit app formPUT /apps/{id}/edit- Update appDELETE /apps/{id}- Delete appPOST /apps/{id}/keys/create- Create API keyDELETE /apps/{id}/keys/{key}/delete- Delete API keyGET /profile- User profilePOST /profile- Update profilePOST /profile/password- Update passwordPOST /logout- Logout
GET /lang/{lang}- Change language
To disable automatic route registration:
// config/shadow.php
'routes' => [
'enabled' => false,
],Then manually register routes in your routes/web.php:
Route::middleware(['web', 'set-locale'])->group(function () {
Route::prefix('portal')->group(function () {
require base_path('vendor/ninjaportal/shadow-theme/routes/web.php');
});
});In Blade views:
@lang('shadow::shadow.home')
{{ __('shadow::shadow.products') }}Available translations:
- English (en)
- Arabic (ar)
{{-- Swagger API Viewer --}}
<x-shadow::swagger-viewer :swagger-file="$url" />
{{-- Product Card --}}
@component('components.product-card', ['product' => $product])
@endcomponent
{{-- Title with Breadcrumbs --}}
@component('components.title', ['breadcrumbs' => $breadcrumbs])
@slot('title')
Page Title
@endslot
@endcomponent
{{-- No Items Message --}}
@include('components.noitems')Automatically registered as set-locale. Sets the application locale based on:
- Cookie value
- Browser preference
- Default locale
Usage:
Route::middleware('set-locale')->group(function () {
// Your routes
});packages/shadow-theme/
├── config/
│ └── shadow.php # Configuration file
├── public/
│ ├── build/ # Built assets
│ └── swagger/ # Swagger UI assets
├── resources/
│ ├── css/
│ │ └── app.scss # Main stylesheet
│ ├── js/
│ │ └── app.js # Main JavaScript
│ ├── lang/
│ │ ├── en/
│ │ │ └── shadow.php # English translations
│ │ └── ar/
│ │ └── shadow.php # Arabic translations
│ ├── theme/ # Blade views
│ │ ├── auth/
│ │ ├── layouts/
│ │ ├── products/
│ │ ├── user/
│ │ └── components/
│ └── views/
│ └── components/ # Package components
├── routes/
│ └── web.php # Package routes
├── src/
│ ├── Commands/
│ │ └── ShadowInstallCommand.php
│ ├── Controllers/
│ ├── Middlewares/
│ ├── Rules/
│ └── ShadowServiceProvider.php
└── composer.json
- PHP ^8.2
- Laravel ^11.0 || ^12.0
- ninjaportal/portal ^0.1
| Tag | Description | Path |
|---|---|---|
shadow |
Minimal required assets | public/vendor/shadow/ |
shadow-assets |
Public assets | public/vendor/shadow/ |
shadow-views |
Blade views | resources/views/vendor/shadow/ |
shadow-config |
Configuration | config/shadow.php |
shadow-frontend |
JS/CSS source files | `resources/js |
shadow-lang |
Translation files | lang/vendor/shadow/ |
shadow-tailwind |
Tailwind config | tailwind.shadow.config.js |
For issues, questions, or contributions, please visit:
- GitHub: ninjaportal/shadow-theme
The Shadow Theme is open-sourced software licensed under the MIT license.