laravel / tinker

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

Whitelist vendor classes for aliasing #76

Closed jasonvarga closed 4 years ago

jasonvarga commented 4 years ago

I'm frequently using Tinker to deal with classes from a package, but the aliasing doesn't happen for classes within vendor.

How about config array that whitelists some classes (and/or namespaces).

'alias' => [
   'Statamic\Entries\Entry',
]

I'm happy to PR this myself, but just wanted to ask before doing so.

driesvints commented 4 years ago

Yeah could be cool I think 👍

zagreusinoz commented 4 years ago

We used to be able to do this with Tinx, however that package is now deprecated so would be great for this to be part of Tinker.

driesvints commented 4 years ago

@zagreusinoz feel free to send in a pr