ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

11_php:02_framework:01_laravel:37_laravel_config

37 Laravel Config ge

config/*以下のconfigファイルをconfig()で呼び出す事ができます。

>>> config('session')
=> [
     "driver" => "memcached",
     "lifetime" => "1440",
     "expire_on_close" => true,
     "encrypt" => false,
     "files" => "/home/matsui/portal.kumolabo.com-dev2/storage/framework/sessions",
     "connection" => null,
     "table" => "sessions",
     "store" => null,
     "lottery" => [
       2,
       100,
     ],
     "cookie" => "laraveldev_session",
     "path" => "/",
     "domain" => null,
     "secure" => false,
     "http_only" => true,
     "same_site" => null,
   ]

定数を用意して利用

$ cat config/const.php 
<?php
return [
    'hogehoge' => [
        'name' => 'hoge',
        'status' => 1,
    ]
];
>>> config('const2')
=> [
     "hogehoge" => [
       "name" => "hoge",
       "status" => 1,
     ],
   ]

11_php/02_framework/01_laravel/37_laravel_config.txt · 最終更新: 2019/06/28 17:24 by matsui