PHPackages                             spatie/laravel-tinker-tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. spatie/laravel-tinker-tools

ActiveLibrary[File &amp; Storage](/categories/file-storage)

spatie/laravel-tinker-tools
===========================

Use short class names in an Artisan tinker session

1.0.1(8y ago)13850.2k11MITPHPPHP ^7.0

Since May 21Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/spatie/laravel-tinker-tools)[ Packagist](https://packagist.org/packages/spatie/laravel-tinker-tools)[ Docs](https://github.com/spatie/laravel-tinker-tools)[ RSS](/packages/spatie-laravel-tinker-tools/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

**The functionality of this package is built into Laravel 5.5 and above, only install this in older Laravel versions**

Use short class names in an Artisan Tinker session
==================================================

[](#use-short-class-names-in-an-artisan-tinker-session)

[![Latest Version on Packagist](https://camo.githubusercontent.com/335df4c1308f72f606f5b7487758987d1dcb0d5a0cb62cb2433afe8b6cd7369d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d74696e6b65722d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-tinker-tools)[![Build Status](https://camo.githubusercontent.com/39abe35a30225dd3617fdcb8f81299e6bf09aebc880b96b10d22b38a220754eb/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f6c61726176656c2d74696e6b65722d746f6f6c732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spatie/laravel-tinker-tools)[![StyleCI](https://camo.githubusercontent.com/43553dd2b5c4b9b02e7d59b672dd1dbf3a14cffa137816a0138ac580f2944f5d/68747470733a2f2f7374796c6563692e696f2f7265706f732f39313938303439352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/91980495)[![Quality Score](https://camo.githubusercontent.com/3edde95e72a1f79a6d45667d9ee122fe6af39033f27ed60fa13ecbaabdbd10a5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f6c61726176656c2d74696e6b65722d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/laravel-tinker-tools)[![Total Downloads](https://camo.githubusercontent.com/9076ec1ba407bbb8f13ff6ea3b4c6d0c0a136a8ef1f5fae8d53df9821821a89e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d74696e6b65722d746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-tinker-tools)

When using Artisan's Tinker command it can be quite bothersome having to type the fully qualified classname to do something simple.

```
\App\Models\NewsItem::first();
```

This package contains a class that, when fully installed lets you use the short class names:

```
NewsItem::first();
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/59a4374ebb005eb8b01c34ec3016d8f044ceb1cee4e53ac4325f6f118bf1c6ac/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d74696e6b65722d746f6f6c732e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-tinker-tools)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

First install the package via Composer:

```
composer require spatie/laravel-tinker-tools
```

Next, create a file named `.psysh.php` in the root of your Laravel app with this content:

```
