orchestral / tenanti

[Package] Multi-tenant Database Schema Manager for Laravel
MIT License
587 stars 53 forks source link

Add tenanti:tinker command #28

Closed i906 closed 8 years ago

i906 commented 8 years ago

Sometime I debug Eloquent models using tinker. This works well when the model uses the default database connection.

However, when the model uses the connection resolved by Tenanti, queries cannot be done using the usual tinker method as the default connection is not yet set.

This PR adds the functionality to set the tenant default connection before executing tinker commands.

Usage:

php artisan tenanti:tinker {driver} {model_id}

Example usage:

php artisan tenanti:tinker franchise 1
coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 87.031% when pulling d9e98ad484b3629c9432be9c11d466d9c518af22 on i906:tinker into 878d6fceb21828ad73dbdad07f4a35a790b051e5 on orchestral:3.2.