Installation Guide - Grazulex/laravel-arc GitHub Wiki
📦 Installation Guide
System Requirements
Minimum Requirements
- PHP: 8.2 or higher
- Laravel: 12.0 or higher
- Composer: 2.0 or higher
- Carbon: 3.10 or higher
Recommended Environment
- PHP: 8.4+ for optimal performance
- Laravel: 12.0+ for latest features
- Memory: 512MB+ available
Installation Methods
1. Composer Installation (Recommended)
composer require grazulex/laravel-arc
2. Development Installation
For contributing or testing:
# Clone the repository
git clone https://github.com/Grazulex/laravel-arc.git
cd laravel-arc
# Install dependencies
composer install
# Run tests
php vendor/bin/phpunit
Package Registration
Auto-Discovery
Laravel Arc uses Laravel's package auto-discovery feature. The service provider is automatically registered when you install the package.
Manual Registration (if needed)
If auto-discovery is disabled, add the service provider to config/app.php
:
'providers' => [
// Other providers...
Grazulex\Arc\ArcServiceProvider::class,
],
Configuration
Laravel Arc works out of the box without configuration. No configuration files need to be published.
Verification
Check Installation
Run this command to verify the installation:
php artisan list | grep arc
You should see Laravel Arc commands available.
Test Basic Functionality
Create a simple test DTO to verify everything works:
<?php
namespace App\DTOs;
use Grazulex\Arc\LaravelArcDTO;
use Grazulex\Arc\Attributes\Property;
class TestDTO extends LaravelArcDTO
{
#[Property(
type: 'string',
required: true,
validation: 'max:100'
)]
public string $name;
#[Property(
type: 'string',
required: false,
validation: 'email'
)]
public ?string $email = null;
}
Test it in php artisan tinker
:
$dto = new App\DTOs\TestDTO(['name' => 'Test', 'email' => '[email protected]']);
echo $dto->name; // 'Test'
echo "Installation successful!";
Troubleshooting
Common Issues
1. "Class not found" Error
Problem: Service provider not loaded
Solution:
composer dump-autoload
php artisan config:clear
php artisan cache:clear
2. Configuration Not Loading
Problem: Config cache issues
Solution:
php artisan config:clear
php artisan config:cache
3. Auto-Discovery Not Working
Problem: Package discovery disabled
Solution: Check composer.json
for:
{
"extra": {
"laravel": {
"dont-discover": []
}
}
}
4. Memory Issues
Problem: PHP memory limit too low
Solution: Increase in php.ini
:
memory_limit = 512M
Available Commands
# Generate DTOs
php artisan make:dto User
# Analyze DTO structure
php artisan dto:analyze UserDTO
# Validate data against DTO
php artisan dto:validate UserDTO --data='{"name":"John"}'
Updating
Standard Update
composer update grazulex/laravel-arc
Major Version Updates
For major version updates, check the Migration Guide and Breaking Changes.
Post-Update Steps
# Clear caches
php artisan config:clear
php artisan cache:clear
# Update published assets (if any)
# Note: Laravel Arc doesn't require published assets
Next Steps
After successful installation:
- 📖 Read the Basic Usage guide
- 🏃♂️ Follow the Quick Start tutorial
- 🔧 Explore Property Attributes
- ✅ Learn about Validation
- 🎨 Discover Advanced Features
Support
If you encounter issues during installation:
- 📋 Check the FAQ for common solutions
- 🐛 Report bugs on GitHub Issues
- 💬 Ask questions in Discussions
- 📧 Contact the maintainer for urgent issues
Installation complete! 🎉 You're ready to start using Laravel Arc's powerful property management features.