beloop/core
Core component of the Beloop LMS suite: shared foundations used by other Beloop components and bundles built on Symfony. MIT licensed. Read-only split package—use the main beloop/components repository for issues, questions, and PRs.
composer why-not to detect conflicts with Laravel’s illuminate/* packages.register()/boot() methods guarantees manual bootstrapping is needed. A wrapper provider is mandatory.Builder vs. older versions) will require adapters. Example:
// Legacy: $query->where('active', 1);
// Laravel 9+: $query->where('active', '=', 1); // Named arguments
Schema::create() vs. older syntax).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| PHP 7.2+ but Laravel 9+ Incompatibility | High | Use PHP 8.0+ polyfills or isolate in a separate service. |
| Deprecated Laravel APIs | High | Abstract via adapters (e.g., Route::bind() → Laravel’s router). |
| Hidden Dependencies | Medium | Static analysis (composer why-not, phpstan). |
| Poor Test Coverage | High | Write integration tests for critical paths. |
| Security Vulnerabilities | Critical | Audit with composer audit; pin all dependencies. |
| Lack of Documentation | High | Reverse-engineer via code + internal wiki. |
// composer.json
"config": {
"platform": {
"php": "8.0.0"
}
}
Vendor\Beloop\Legacy) and create facades/services to expose functionality.$this->app->bind(BeloopService::class, function ($app) {
return new BeloopService(
new BeloopCore(), // Legacy instance
$app['db'] // Laravel DB adapter
);
});
parameters.legacy_method).composer require --dev phpunit/phpunit ^9 to test in a Laravel-like environment.Route::bind() → Laravel’s router).// BeloopServiceProvider.php
public function register()
{
$this->app->singleton(BeloopCore::class, function ($app) {
$core = new \Beloop\Core();
// Adapt DB connection
$core->setConnection($app['db']->connection());
return $core;
});
}
if (config('features.beloop_auth')) {
auth()->shouldUse(BeloopGuard::class);
}
use Illuminate\Database\Eloquent\Factories\HasFactory;
class BeloopUser extends \Beloop\Core\Model {
use HasFactory;
}
class BeloopQueryBuilder extends Builder {
public function beloopWhere($column, $operator = null, $value = null)
{
return $this->where($column, $operator, $value);
}
}
Event::dispatch():
Event::listen(\Beloop\Core\Events\OrderCreated::class, function ($event) {
event(new \App\Events\OrderProcessed($event->order));
});
.env keys into Laravel’s config:
// config/beloop.php
'database' => env('BELOOP_DB_CONNECTION', 'mysql'),
README.md with Laravel-specific setup (e.g., provider registration, config merging).# docker-compose.yml
services:
laravel:
build: .
beloop_legacy:
image: php:7.4-cli
volumes: [./vendor/beloop:/app]
How can I help you explore Laravel packages today?