By John Koster
database_path($path = '')
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
.
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<?php
2
3// /home/vagrant/Code/Laravel/database
4database_path();
5
6// /home/vagrant/Code/Laravel/migrations
7database_path('migrations');
8
9// /home/vagrant/Code/Laravel/seeds/
10str_finish(database_path('seeds'), '/'):
∎