Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spatie/laravel-tinker-tools
Use short class names in an Artisan tinker session
https://github.com/spatie/laravel-tinker-tools
composer devtools laravel php
Last synced: 4 days ago
JSON representation
Use short class names in an Artisan tinker session
- Host: GitHub
- URL: https://github.com/spatie/laravel-tinker-tools
- Owner: spatie
- License: mit
- Created: 2017-05-21T19:00:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-21T13:00:22.000Z (over 2 years ago)
- Last Synced: 2024-08-13T01:17:56.178Z (3 months ago)
- Topics: composer, devtools, laravel, php
- Language: PHP
- Homepage: https://murze.be/2017/05/package-enable-short-class-names-artisan-tinker-session/
- Size: 40 KB
- Stars: 138
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://supportukrainenow.org)
**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
[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-tinker-tools.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-tinker-tools)
[![Build Status](https://img.shields.io/travis/spatie/laravel-tinker-tools/master.svg?style=flat-square)](https://travis-ci.org/spatie/laravel-tinker-tools)
[![StyleCI](https://styleci.io/repos/91980495/shield?branch=master)](https://styleci.io/repos/91980495)
[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-tinker-tools.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-tinker-tools)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-tinker-tools.svg?style=flat-square)](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.
```php
\App\Models\NewsItem::first();
```This package contains a class that, when fully installed lets you use the short class names:
```php
NewsItem::first();
```## Support us
[](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
First install the package via Composer:
``` bash
composer require spatie/laravel-tinker-tools
```Next, create a file named `.psysh.php` in the root of your Laravel app with this content:
```php