If an user is able to run php artisan tinker
, he is also able to:
See the source code of your project. He probably can edit it too, but it may not be the case with proper file permissions
See your .env
, containing your database credentials and other sensitive information such as api keys
I'm not sure it is actually useful to restrict access inside tinker to an user that already has so many privilegies and possibilities. He could edit your database users
table to grant access to a user controlled by himself for example, or he could edit the source code to allow access.
Here is a little visualization of the problem: