Reload does not reload files
Maybe I'm misunderstanding how Tinx is supposed to work, but I had assumed included files would automatically be reloaded. For example:
use App\Utils\GeoIP;
re()
$geo = new GeoIP();
PHP Fatal error: Class 'GeoIP' not found in Psy Shell code on line 1
Is this a bug, or can Tinx not handle this case? Thanks!
Hi @kcornbower,
Can you please provide the following details so I can look into this further for you?
- Your Tinx version (
composer info ajthinking/tinx) - Your PHP version (
php -v) - Your Laravel version (
php artisan -V) - Your development environment and version (Valet? Homestead? etc)
- Your operating system and version (Mac? Windows? etc)
Cheers.
Hi @kcornbower (again),
Recent versions of Laravel Tinker should automatically alias/resolve class paths for you, providing those class paths exist in your vendor/composer/autoload_classmap.php file.
If you either…
- run
composer dump -obefore starting Tinx - run
exec("composer dump -o") && re()in your existing Tinx session
…then run your $geo = new GeoIP(); statement again…

…is the GeoIP class now automatically aliased/resolved for you?
Cheers.
Hi @furey,
Awesome, running the exec command in Tinx solved the problem. Is there any way to have this run automatically? Maybe adding this in the documentation would be helpful, unless I somehow missed it.
Hi @kcornbower,
I've just pushed a new release that adds a reo() function to Tinx implementing the functionality mentioned above, and added a note about it in the README to help users with similar issues in the future.
Cheers.