Tinkerwell 4 is out now! Get the most popular PHP Scratchpad application. Tinkerwell 4 is out now: Get the most popular PHP Scratchpad with Detail Dive, AI code generation and more. Learn more
Invoker provides you with a beautiful user interface to browse through your Eloquent models. By selecting the models icon in the navigation bar, Invoker will show you a list of all the Eloquent models that were found in your application, grouped by namespace.
By selecting a model, you will see a table view showing you the model and all of its data.
By default, Invoker does not scan your applications' composer dependencies for additional Eloquent models, for performance reasons. But sometimes you might want to browse models provided by additional packages - such as Laravel Cashier. In this case, you can instruct Invoker to scan your applications composer dependencies for Eloquent models. This can be activated in the Invoker settings.
Invoker shows you all available columns that exist in the database table of the selected Eloquent model. If you want to hide certain columns from your table, or change the order of the columns, you can click on the "eye" icon.
You can drag and drop the columns and enable or disable them in order to show/hide them in the table view.
Invoker allows you to not only see your database columns, but it can also access data and information that you have stored in your Eloquent models - such as custom accessors.
For example, you could add a custom accessor to a Comment
model, that will return the word count of the given comment. You can add this to your Comment.php
model class, just as you would normally do it with Laravel.
public function getWordCountAttribute()
{
return str_word_count($this->comment);
}
When you click on the "eye" icon in Invoker, you will now see that there is a word_count
accessor available for selection.
After enabling the accessor, Invoker will reload the visible data and show you the accessor value for each of your Comment
models.
To quickly edit a single column for one of your models, you can double-click on the column you want to change to pop up an inline editor. The editor type will depend on the column type that you are editing.
You can duplicate single models in Invoker by using the "Duplicate" menu item from the right-click context menu on the model table view. This will open up the data from the selected model in a modal view.
Before the duplicated model gets persisted to the database, you can make additional changes to the model data and finally save it.
The context menu of the Invoker model data allows you to copy the selected model(s) into various different output formats: JSON, CSV, HTML table and even PHP.
To copy multiple models at once, either select the models using keyboard shortcuts, such as CMD/CTRL+A, or shift+click the models for multiple selections.
When your database table contains more models than would fit on the current page, Invoker is going to paginate the results automatically. The default amount of models per page is 15. You can modify this value either temporarily on the table itself, using the settings icon on the lower right:
Or you can modify the value globally in the Invoker settings.