laravel / tinker

Powerful REPL for the Laravel framework.
https://laravel.com/docs/artisan#tinker
MIT License
7.32k stars 130 forks source link

Master #176

Closed kenng closed 4 months ago

kenng commented 4 months ago

This pull request adds support for class_alias to Tinker's configuration.

Motivation: We created a model App\Models\Event, which conflicts with the events facade. As a result, instead of the Event model class being aliased, the events facade was aliased.

This solution allows users to map the conflicting class name to another class. For example, in config/tinker.php.

<?php

return [
    'class_alias' => [
        'AppEvent' => App\Models\Event::class,
    ],
];
driesvints commented 4 months ago

Please send this to master instead.