Integrate Editor with Laravel

Integrate Editor with Laravel

kooliebwoykooliebwoy Posts: 7Questions: 3Answers: 0

How can I access $db variable from a Laravel Model? Out of the class it works just fine, but inside the class $db just shows as null no matter what I do.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Answer ✓

    The $db variable that is used in the Editor examples is an instance of the Editor Database class. It is unlikely to actually be all that useful for anything else since it has its own API.

    Having said that, you can use $db->resource() to get the PDO object being used by Editor, which could then be used by other libraries.

    $db is created by the Bootstrap.php file that the Editor examples include.

    Allan

This discussion has been closed.