{"id":13452851,"url":"https://github.com/furey/tinx","last_synced_at":"2025-03-23T21:34:59.106Z","repository":{"id":56943200,"uuid":"107278698","full_name":"furey/tinx","owner":"furey","description":"⛔️ Laravel Tinx is archived and no longer maintained.","archived":true,"fork":false,"pushed_at":"2019-12-14T14:53:45.000Z","size":112,"stargazers_count":449,"open_issues_count":0,"forks_count":39,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-17T16:49:23.782Z","etag":null,"topics":["archived","deprecated","laravel","laravel-tinker","obsolete","php","tinker"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/furey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-17T14:19:20.000Z","updated_at":"2024-05-15T21:53:44.000Z","dependencies_parsed_at":"2022-08-21T07:50:46.473Z","dependency_job_id":null,"html_url":"https://github.com/furey/tinx","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furey%2Ftinx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furey%2Ftinx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furey%2Ftinx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furey%2Ftinx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furey","download_url":"https://codeload.github.com/furey/tinx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221918517,"owners_count":16901640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archived","deprecated","laravel","laravel-tinker","obsolete","php","tinker"],"created_at":"2024-07-31T08:00:24.550Z","updated_at":"2024-10-28T19:31:01.299Z","avatar_url":"https://github.com/furey.png","language":"PHP","funding_links":[],"categories":["Popular Packages","PHP","Packages"],"sub_categories":["Development Tools"],"readme":"# ⛔️ Laravel Tinx (Deprecated)\n\n[![No Maintenance Intended](./readme/unmaintained.svg)](http://unmaintained.tech/)\n\n**Laravel Tinx** was archived on 12th December 2019 and is no longer maintained.\n\nLooking for a reloadable version of [Laravel Tinker](https://github.com/laravel/tinker)?\n\nSave the following script as `tinx.sh` to your project root directory:\n\n```bash\n#!/bin/sh\nwhile true; do php artisan tinker; done\n```\n\nRun the script to launch a reloadable version of Tinker:\n\n```console\n$ . tinx.sh\n```\n\nWhile your Tinker session is running, press:\n\n- \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eD\u003c/kbd\u003e from an empty prompt to **reload** your session\n- \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eC\u003c/kbd\u003e to **exit** your session\n\nCan't see newly created classes in Tinker?\n\nExit your Tinker session and run:\n\n```console\n$ composer dump -o\n```\n\nThanks for loving [Laravel](https://laravel.com), and thanks for digging Tinx.\n\nHappy coding!\n\n🤓👋\n\n---\n\n# Laravel Tinx\n\n[Laravel Tinker](https://github.com/laravel/tinker), \u003cb\u003ere()\u003c/b\u003eloaded.\n\nReload your session from inside Tinker, plus magic shortcuts for first(), find(), where(), and more!\n\n\u003cimg src=\"https://i.imgur.com/U9NnDix.gif\" title=\"source: imgur.com\" /\u003e\n\n## Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  * [Reload your Tinker session](#reload-your-tinker-session)\n  * [Magic models](#magic-models)\n  * [Naming strategy](#naming-strategy)\n  * [Names](#names)\n  * [Fast factories](#fast-factories)\n- [Configuration](#configuration)\n- [Contributing](#contributing)\n- [License](#license)\n  \n## Installation\n\nTo install Tinx, simply require it via Composer:\n\n```bash\ncomposer require --dev ajthinking/tinx\n```\n\nIf using Laravel \u003c=5.4, register Tinx's service provider in `config/app.php` (Laravel \u003e=5.5 [does this automatically](https://laravel.com/docs/5.5/packages#package-discovery)):\n\n```php\n\u003c?php\n\n// 'config/app.php'\n\nreturn [\n    // etc…\n    'providers' =\u003e [\n        // etc…\n        Ajthinking\\Tinx\\TinxServiceProvider::class,\n        // etc…\n    ],\n    // etc…\n];\n```\n\n## Usage\n\nFrom the command line, instead of running `php artisan tinker`, run:\n\n```\nphp artisan tinx\n```\n\n### Reload your Tinker session\n\nTo reboot your current session, simply call:\n\n```\nre()\n```\n\nThis will allow you to immediately test out your application's code changes.\n\nAliases: `reboot()`, `reload()`, `restart()`.\n\nTo regenerate Composer's optimized autoload files before rebooting your current session, call:\n\n```\nreo()\n```\n\nCalling `reo()` simply runs `composer dump -o` before `re()`, ensuring any new classes added to your codebase since starting Tinx are automatically aliasable/resolvable by Laravel Tinker.\n\n### Magic models\n\nTinx sniffs your models and prepares the following shortcuts:\n\n| Example Shortcut            | Equals                                              |\n|:--------------------------- |:--------------------------------------------------- |\n| `$u`                        | `App\\User::first()`                                 |\n| `$u_`                       | `App\\User::latest()-\u003efirst()`                       |\n| `$c`                        | `App\\Models\\Car::first()`                           |\n| `u(3)`                      | `App\\User::find(3)`                                 |\n| `u(\"gmail\")`                | `Where \"%gmail%\" is found in any column.`           |\n| `u(\"mail\", \"jon@snow.com\")` | `App\\User::where(\"mail\", \"jon@snow.com\")-\u003eget()`    |\n| `u(\"id\", \"\u003e\", 0)`           | `App\\User::where(\"id\", \"\u003e\", 0)-\u003eget()`              |\n| `u()`                       | `\"App\\User\"`                                        |\n| `u()::whereRaw(...)`        | `App\\User::whereRaw(...) // Note: \u003e= PHP 7.0 only`  |\n\n### Naming strategy\n\nTinx calculates shortcut names via the implementation defined by your `strategy` config value.\n\nLets say you have two models: `Car` and `Crocodile`.\n\nIf your naming `strategy` was set to `pascal` (default), Tinx would define the following shortcuts in your session:\n\n- Car: `$c`, `$c_`, `c()`\n- Crocodile: `$cr`, `$cr_`, `cr()`\n\n### Names\n\nThe shortcuts defined for your session will display when Tinx loads and on subsequent reloads.\n\nTo see your shortcuts at any time during your session, run:\n\n```\nnames()\n```\n\nYour shortcuts will initially display only if your session satisfies the `names_table_limit` config value.\n\nTo filter the shortcuts returned by `names()`, simply pass your filter terms like so:\n\n```\nnames('car', 'user')\n```\n\n### Fast factories\n\nShortcut methods are a great way to create factory models fast.\n\n```php\n// Instead of this…\nfactory(App\\User::class)-\u003ecreate()\n\n// …try substituting a shortcut method, like this:\nfactory(u())-\u003ecreate()\n```\n\nWhen tinkering, every keystroke counts!\n\n## Configuration\n\nTinx contains a number of helpful configuration options.\n\nTo personalise your Tinx installation, publish its config file by running:\n\n```\nphp artisan vendor:publish --provider=Ajthinking\\\\Tinx\\\\TinxServiceProvider --force\n```\n\nOnce published, edit `config/tinx.php` where appropriate to suit your needs:\n\n```php\n\u003c?php\n\n// 'config/tinx.php'\n\nreturn [\n\n    /**\n     * Base paths to search for models (paths ending in '*' search recursively).\n     * */\n    'model_paths' =\u003e [\n        '/app',\n        '/app/Models/*',\n        // '/also/search/this/directory',\n        // '/also/search/this/directory/recursively/*',\n    ],\n\n    /**\n     * Only define these models (all other models will be ignored).\n     * */\n    'only' =\u003e [\n        // 'App\\OnlyThisModel',\n        // 'App\\AlsoOnlyThisModel',\n    ],\n\n    /**\n     * Ignore these models.\n     * */\n    'except' =\u003e [\n        // 'App\\IgnoreThisModel',\n        // 'App\\AlsoIgnoreThisModel',\n    ],\n\n    /**\n     * Model shortcut naming strategy (e.g. 'App\\User' = '$u', '$u_', 'u()').\n     * Supported values: 'pascal', 'shortestUnique'\n     * */\n    'strategy' =\u003e 'pascal',\n    /**\n     * Alternatively, you may pass a resolvable fully qualified class name\n     * implementing 'Ajthinking\\Tinx\\Naming\\Strategy'.\n     * */\n    // 'strategy' =\u003e App\\CustomNamingStrategy::class,\n\n    /**\n     * Column name (e.g. 'id', 'created_at') used to determine last model shortcut (i.e. '$u_').\n     * */\n    'latest_column' =\u003e 'created_at',\n\n    /**\n     * If true, models without database tables will also have shortcuts defined.\n     * */\n    'tableless_models' =\u003e false,\n\n    /**\n     * Include these file(s) before starting tinker.\n     * */\n    'include' =\u003e [\n        // '/include/this/file.php',\n        // '/also/include/this/file.php',\n    ],\n\n    /**\n     * Show the console 'Class/Shortcuts' table for up to this many model names, otherwise, hide it.\n     * To always view the 'Class/Shortcuts' table regardless of the model name count,\n     * pass a 'verbose' flag when booting Tinx (e.g. \"php artisan tinx -v\"),\n     * or set this value to '-1'.\n     * */\n    'names_table_limit' =\u003e 10,\n\n];\n```\n\n## Contributing\n\nPlease post issues and send PRs.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurey%2Ftinx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurey%2Ftinx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurey%2Ftinx/lists"}