ユーザ用ツール

サイト用ツール


11_php:02_framework:01_laravel:37_laravel_config
no way to compare when less than two revisions

差分

このページの2つのバージョン間の差分を表示します。


11_php:02_framework:01_laravel:37_laravel_config [2019/06/28 08:24] (現在) – 作成 matsui
行 1: 行 1:
 +====== 37 Laravel Config ge ======
  
 +config/*以下のconfigファイルをconfig()で呼び出す事ができます。
 +
 +
 +===== 例 =====
 +<code>
 +>>> 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,
 +   ]
 +</code>
 +
 +==== 定数を用意して利用 ====
 +
 +<code>
 +$ cat config/const.php 
 +<?php
 +return [
 +    'hogehoge' => [
 +        'name' => 'hoge',
 +        'status' => 1,
 +    ]
 +];
 +>>> config('const2')
 +=> [
 +     "hogehoge" => [
 +       "name" => "hoge",
 +       "status" => 1,
 +     ],
 +   ]
 +
 +</code>
 +
 +{{tag>Laravel}}
11_php/02_framework/01_laravel/37_laravel_config.txt · 最終更新: 2019/06/28 08:24 by matsui