edrush/extbaser
Laravel package providing Baseer-related integrations and utilities, offering helper classes and configuration to speed up common workflows. Lightweight and easy to drop into existing apps for basic setup, requests, and shared functionality.
Installation
composer require edrush/extbaser --dev
(Note: Package is now updated to v0.1.0; verify compatibility with Laravel 8+/9+.)
Initial Setup
ExtensionBuilder.json from your database schema:
php artisan extbaser:generate
config/extbaser.php (if available) or command arguments.First Use Case
users table with columns id, name, email).ExtensionBuilder.json in your project root (defining modules, relations, and wires).ExtensionBuilder.json for correctness.ExtensionBuilder-First Development
extbaser to scaffold ExtensionBuilder.json after defining the database schema.{
"modules": {
"User": {
"table": "users",
"relations": {
"posts": {
"type": "hasMany",
"foreignKey": "user_id"
}
}
}
}
}
Integration with Laravel Eloquent
ExtensionBuilder.json (if configured).app/Models/:
// app/Models/User.php
class User extends Model {
protected $fillable = ['name', 'email'];
public function posts() {
return $this->hasMany(Post::class);
}
}
TYPO3 Extension Builder Workflow
ExtensionBuilder.json to scaffold TYPO3 extensions:
vendor/bin/extension-builder create --json=ExtensionBuilder.json
API and Repository Layer
UserResource) and repositories to abstract business logic:
// app/Repositories/UserRepository.php
public function findWithPosts($userId) {
return User::with('posts')->find($userId);
}
.env has correct DB credentials before generation.extbaser.php:
'mappings' => [
'users' => 'UserModule', // Maps `users` table to `UserModule` in ExtensionBuilder.json
],
--tables to generate only specific tables:
php artisan extbaser:generate --tables=users,posts
hasMany, belongsTo) in the config:
'relations' => [
'posts' => 'hasMany',
'user' => 'belongsTo'
],
Breaking Changes in v0.1.0
ExtensionBuilder.json.--generate-models flag (if added) or post-process the JSON.TYPO3-Specific Quirks
ExtensionBuilder.json may require manual adjustments for TYPO3-specific fields (e.g., controllerActions).Limited Laravel Integration
Relation Parsing Issues
extbaser.php or edit ExtensionBuilder.json manually.storage/logs/laravel.log for schema parsing issues (e.g., missing foreign keys).ExtensionBuilder.json is syntactically correct.php artisan tinker:
DB::connection()->getPdo();
Custom JSON Templates
ExtensionBuilder.json template by publishing the config:
php artisan vendor:publish --tag=extbaser-config
iconIdentifier).Post-Generation Scripts
booted event to sync ExtensionBuilder.json with models:
// app/Providers/AppServiceProvider.php
public function boot() {
if (file_exists(base_path('ExtensionBuilder.json'))) {
$this->syncExtensionBuilderWithModels();
}
}
Testing
public function test_extension_builder_json() {
Artisan::call('extbaser:generate');
$this->assertFileExists(base_path('ExtensionBuilder.json'));
$json = json_decode(file_get_contents(base_path('ExtensionBuilder.json')), true);
$this->assertArrayHasKey('modules', $json);
}
ExtensionBuilder.json to scaffold Nova resources:
php artisan nova:resource User --model=User --json=ExtensionBuilder.json
ExtensionBuilder.json:
// Use Laravel Filesystem events to trigger TYPO3 extension rebuilds.
ExtensionBuilder.json using tools like Swagger.How can I help you explore Laravel packages today?