Integrate Editor with Laravel
Integrate Editor with Laravel
kooliebwoy
Posts: 7Questions: 3Answers: 0
in Editor
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
This discussion has been closed.
Answers
The
$db
variable that is used in the Editor examples is an instance of the EditorDatabase
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 theBootstrap.php
file that the Editor examples include.Allan