LoginSignup
0
0

More than 5 years have passed since last update.

Config dirのsub dir指定

Last updated at Posted at 2016-03-22

config\app.php の url を得る場合

公式マニュアル通りに
設定値にアクセスする

php
namespace App\Http\Controllers;
use Config;
class IndexController extends Controller
{
    public function getIndex()
    {
           echo Config::get('app.url');     

自分でsub dirを切った場合

例えば configの下にusers dirを作って
config\users\app.php の url を得る場合

php
namespace App\Http\Controllers;
use Config;
class IndexController extends Controller
{
    public function getIndex()
    {
           echo Config::get('users.app.url');       

sub dirを切れば自前で追加したconfigが整理されてよい :D

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