I needed to get the db prefix for a raw insert query I was running. It’s an easy function call to get the current database prefix. Will output the prefix for the current database. This will work in laravel 4.
In order to get the base directory of a laravel 4 install you’ll just need to do one command. It’s fairly simple.