6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Laravelでフルパスを取得するときは...

Last updated at Posted at 2013-05-27

忘れないうちにメモ。

Laravelでフルパスを取得するときは、paths.phpの中にあるpath()関数を使用するといいです。
引数に以下のものを指定して使います。

array(6) {
  ["base"]=>
   "/path/to/laravel/"
  ["app"]=>
   "/path/to/laravel/application/"
  ["sys"]=>
   "/path/to/laravel/laravel/"
  ["bundle"]=>
   "/path/to/laravel/bundles/"
  ["storage"]=>
   "/path/to/laravel/storage/"
  ["public"]=>
   "/path/to/laravel/public/"
}

例えば、publicの中にhogeディレクトリを作る場合は

File::mkdir(path('public') . 'hoge');

っていうふうにすると、いいんじゃないかと思う。

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?