By John Koster
The database_path
function can be used to retrieve the path to the database directory. It can also be used to construct paths relative to the database directory by supplying a $path
.
#Signature
The signature of the database_path
function is:
1function database_path(
2 $path = ''
3);
#Example Use
The following examples will assume that the Laravel application is installed in the
/home/vagrant/Code/Laravel/
directory. The resulting path will appear above the function calls as a comment.
1// /home/vagrant/Code/Laravel/database
2database_path();
3
4// /home/vagrant/Code/Laravel/migrations
5database_path('migrations');
6
7// /home/vagrant/Code/Laravel/seeds/
8str_finish(database_path('seeds'), '/'):
∎