Shadow
Table of Contents
Shadow Documentation
Welcome to the comprehensive documentation for Shadow - a powerful Laravel package that automatically generates RESTful APIs for your Eloquent models.
š What is Shadow?
Shadow is a robust Laravel package that transforms your Eloquent models into fully-featured RESTful APIs with minimal configuration. It provides automatic endpoint generation, standardized responses, comprehensive error handling, and advanced features like caching, documentation generation, and foreign key resolution.
šÆ Key Features
- š Automatic API Generation: Instant RESTful endpoints for all your models
- š Standardized Responses: Consistent JSON response format across all endpoints
- š Relationship Support: Automatic handling of model relationships and foreign keys
- ā” Performance: Built-in caching and query optimization
- š Documentation: Auto-generated API documentation (Swagger, Postman, Markdown)
- š”ļø Security: Comprehensive error handling and validation
- š§ Flexible Configuration: Extensive customization options
- šØ Modern Architecture: Clean, extensible codebase
š Quick Start
Ready to get started? Here's how to install Shadow and create your first API:
# Install Shadow
composer require thinkneverland/shadow
# Publish configuration
php artisan vendor:publish --provider="Thinkneverland\Shadow\ShadowServiceProvider" --tag="config"
# Register routes
# Add to your RouteServiceProvider.php:
Shadow::routes();
ā©
Add the HasShadow trait to your model:
use Thinkneverland\Shadow\Traits\HasShadow;
class User extends Model
{
use HasShadow;
protected $fillable = ['name', 'email'];
}
ā©
That's it! Your API is now available at /shadow-api/model/users.
š Documentation Structure
š Getting Started
- Installation Guide - Complete setup instructions
- Quick Start - Your first API in 5 minutes
- Basic Configuration - Essential settings
š Core Concepts
- Architecture Overview - How Shadow works
- Model Integration - Working with Eloquent models
- API Endpoints - Understanding generated routes
- Response Format - Standardized response structure
š§ Configuration
- Configuration Reference - All available options
- Model Configuration - Per-model settings
- Route Configuration - Customizing API routes
- Cache Configuration - Performance optimization
š ļø Usage Guides
- Basic Operations - CRUD operations
- Advanced Queries - Filtering, sorting, searching
- Relationships - Working with related data
- Validation - Input validation and error handling
š Advanced Features
- Caching Strategies - Performance optimization
- Custom Controllers - Extending functionality
- Middleware - Request/response processing
- Events - Hooks and custom logic
š API Reference
- Endpoint Reference - Complete API documentation
- Query Parameters - Available query options
- Response Examples - Real-world usage examples
- Error Codes - Error handling reference
š Security & Performance
- Security Best Practices - Keeping your API secure
- Authentication - User authentication
- Authorization - Access control
- Performance Optimization - Speed and efficiency
š ļø Development
- Extending Shadow - Custom functionality
- Testing - Testing your APIs
- Debugging - Troubleshooting guide
- Contributing - Contributing to Shadow
š Additional Resources
- Troubleshooting - Common issues and solutions
- Migration Guide - Upgrading between versions
- Examples - Real-world implementations
- FAQ - Frequently asked questions
šÆ Use Cases
Shadow is perfect for:
- Rapid Prototyping: Quickly create APIs for new projects
- Admin Panels: Generate admin interfaces with minimal code
- Mobile Backends: Provide APIs for mobile applications
- Microservices: Create focused API services
- Content Management: Build CMS APIs with ease
- E-commerce: Generate product and order APIs
- Social Platforms: Create user and content APIs
š§ System Requirements
- PHP: 8.1 or higher
- Laravel: 9.0 or higher
- Database: MySQL 5.7+, PostgreSQL 9.6+, or SQLite 3.8+
š Support
- Documentation: Browse the comprehensive guides above
- Issues: Report bugs and request features on GitHub
- Discussions: Join the community discussions
- Email: support@thinkneverland.com
š License
Shadow is open-source software licensed under the MIT License.
Ready to dive in? Start with our Installation Guide to get Shadow up and running in your Laravel application.