0
0

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 1 year has passed since last update.

Laravelでデフォルト以外のディレクトリでfactoryを読み込む

Posted at

背景

先日ユニットテストを実装中に、factoryを規定のディレクトリ以外から読み込みたいことがあった。

そのプロジェクトではリポジトリパターンを採用していて、

factoryがvendor配下にあるという特殊な作りをしていたため。

実装方法

app()->useDatabasePath('vendor/models/database');

これでvendor配下がfactoryの置き場所として読み込まれる。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?