ninjaportal / shadow-theme
A Laravel Like Apigee DevPortal
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ninjaportal/shadow-theme
Requires
- php: ^8.2
- blade-ui-kit/blade-heroicons: 2.6.0
- guzzlehttp/guzzle: ^7.2
- illuminate/contracts: ^12.0
- nesbot/carbon: ^3.0
- ninjaportal/portal: ^0.1
- spatie/laravel-package-tools: ^1.16.3
This package is auto-updated.
Last update: 2025-11-09 23:56:04 UTC
README
A beautiful, modern Laravel theme package for API Developer Portals with built-in authentication, product management, and multi-language support.
Features
✨ 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
Installation
Quick Install (Recommended)
composer require ninjaportal/shadow-theme
php artisan shadow:install
npm install && npm run build
That's it! The theme is now active and working.
Custom Install
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 files
How It Works
Auto-Registration
The 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/
View Loading Hierarchy
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!
Configuration
Environment Variables
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=
Config File
Publish the config file for more control:
php artisan vendor:publish --tag=shadow-config
Then 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, ], ];
Customization
Customizing Views
Publish views to modify them:
php artisan vendor:publish --tag=shadow-views
Views will be published to resources/views/vendor/shadow/. Modify any view and it will override the package version.
Customizing Translations
php artisan vendor:publish --tag=shadow-lang
Translations will be published to lang/vendor/shadow/. Add new languages or modify existing ones.
Customizing Frontend
php artisan vendor:publish --tag=shadow-frontend
This publishes JS and CSS files to resources/js/vendor/shadow/ and resources/css/vendor/shadow/.
Customizing Tailwind
php artisan vendor:publish --tag=shadow-tailwind
This publishes tailwind.shadow.config.js for complete theme customization.
Routes
The package registers the following routes:
Public 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
Protected Routes (auth required)
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
Utility Routes
GET /lang/{lang}- Change language
Disabling Routes
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'); }); });
Translation Usage
In Blade views:
@lang('shadow::shadow.home') {{ __('shadow::shadow.products') }}
Available translations:
- English (en)
- Arabic (ar)
Components
Blade Components
{{-- 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')
Middleware
SetLocaleMiddleware
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 });
Directory Structure
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
Requirements
- PHP ^8.2
- Laravel ^11.0 || ^12.0
- ninjaportal/portal ^0.1
Publishing Tags
| 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 |
Support
For issues, questions, or contributions, please visit:
- GitHub: ninjaportal/shadow-theme
License
The Shadow Theme is open-sourced software licensed under the MIT license.