Installation Clone the mirror repo and install via Composer:
composer create-project chill-project/main chill-app
cd chill-app
composer install
Laravel Integration
Add the package to config/app.php under providers:
'providers' => [
// ...
Chill\Main\Providers\ChillServiceProvider::class,
],
Publish the config:
php artisan vendor:publish --provider="Chill\Main\Providers\ChillServiceProvider" --tag="config"
First Use Case Run migrations and seed the database:
php artisan migrate --seed
Access the admin panel at /admin (default credentials: [email protected] / password).
Social-Profit Features
Chill\Main\Models\User with custom traits for roles (e.g., Organizer, Volunteer):
use Chill\Main\Traits\HasOrganizerRole;
class CustomUser extends User {
use HasOrganizerRole;
}
Chill\Main\Events\Event model for CRUD operations:
$event = Event::create([
'title' => 'Community Cleanup',
'organizer_id' => auth()->id(),
'start_at' => now()->addDays(7),
]);
API Integration
/api/events) with Laravel Sanctum for authentication:
Route::middleware('auth:sanctum')->get('/api/events', [EventController::class, 'index']);
Frontend Templates
resources/views/vendor/chill to customize UI:
@extends('chill::layouts.app')
@section('content')
{{ $slot }}
@endsection
Chill\Main\Services\EventService for business logic:
public function __construct(private EventService $eventService) {}
EventObserver for notifications):
Event::observe(EventObserver::class);
Database Schema
database/migrations/chill_* with MySQL syntax.DB::connection()->getDoctrineSchemaManager() for schema-agnostic queries.Deprecated Methods
User::getChillRoles()) may be renamed. Check chill.php config for aliases.Caching Quirks
Chill\Main\Services\CacheService can cause stale data. Clear cache after model updates:
php artisan chill:clear-cache
chill.php:
'debug' => env('APP_DEBUG', true),
php artisan chill:listeners to inspect registered listeners.Custom Models Override core models by publishing and extending:
php artisan vendor:publish --provider="Chill\Main\Providers\ChillServiceProvider" --tag="models"
Example:
namespace App\Models;
use Chill\Main\Models\Event as BaseEvent;
class Event extends BaseEvent {
protected $table = 'custom_events';
}
API Resources
Extend Chill\Main\Http\Resources\EventResource for custom fields:
public function toArray($request) {
return array_merge(parent::toArray($request), [
'custom_field' => $this->custom_field,
]);
}
Middleware
Add custom middleware to app/Http/Kernel.php:
protected $routeMiddleware = [
'chill.auth' => \Chill\Main\Http\Middleware\Authenticate::class,
'custom.chill' => \App\Http\Middleware\CustomChillMiddleware::class,
];
How can I help you explore Laravel packages today?