# How to integration Psysh in Slim Project? \[ SOLVED \]

**URL:** <https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181>\
**Category:** Questions\
**Created:** [January 23, 2018, 12:24pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181 "2018-01-23T12:24:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![betta\_ratna](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/betta_ratna/32/530_2.png) [@betta\_ratna](https://discourse.slimframework.com/u/betta_ratna)\
**Post date:** [January 23, 2018, 12:24pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181/1 "2018-01-23T12:24:22Z")

</div>

I use Slim 3 and other modules like eloquent model, database, etc. I tried to integrate with [Psysh](http://psysh.org/) to interact with my Slim Application. But does’t work. So what can i do?

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [January 23, 2018, 1:28pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181/2 "2018-01-23T13:28:47Z")

</div>

You could use PhpStorm with XDebug. Works great 🙂

---

<div class="post-metadata">

**Author:** ![betta\_ratna](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/betta_ratna/32/530_2.png) [@betta\_ratna](https://discourse.slimframework.com/u/betta_ratna)\
**Post date:** [January 23, 2018, 2:24pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181/3 "2018-01-23T14:24:09Z")

</div>

but i use vscode to develop slim applications. I tried to install psysh but when trying to access Eloquent Model I get error or indeed tinker only for Laravel.

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [January 23, 2018, 3:58pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181/4 "2018-01-23T15:58:11Z")

</div>

XDebug also works well with Visual Studio code (+PHP Debug).

[https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug)

What’s the error message?

---

<div class="post-metadata">

**Author:** ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)\
**Post date:** [February 13, 2018, 8:37pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181/5 "2018-02-13T20:37:04Z")

</div>

@betta_ratna I use Slim with Psysh and Eloquent, it works well for me. I’ve created a `psysh.php` file that looks something like this.

```php
<?php

require __DIR__. '/vendor/autoload.php';
date_default_timezone_set('UTC');

$app = new App\App();

$capsule = $app->getContainer()->get('capsule');
$capsule->setAsGlobal();
$capsule->bootEloquent();

echo "Welcome to Slim Psysh!\n";

```

You might need to do something a little different, particularly with the App\App, you might need something like `$app = new \Slim\App();`

I’ve got Psysh installed globally, so I run `$ psysh psysh.php` from the terminal and can then access all of my Eloquent models.

---

<div class="post-metadata">

**Author:** ![betta\_ratna](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/betta_ratna/32/530_2.png) [@betta\_ratna](https://discourse.slimframework.com/u/betta_ratna)\
**Post date:** [February 15, 2018, 2:00pm UTC](https://discourse.slimframework.com/t/how-to-integration-psysh-in-slim-project-solved/2181/6 "2018-02-15T14:00:35Z")

</div>

Thanks everyone i have solved my problem. I create tinker for slim application integrate with symfony process. If you want to see my work please support and give me your opinion.

[Harmony Betta Framework Built Under Slim 3](https://harmony-betta.github.io)
