コントローラー内とビュー内で使い方が少々違うのだが、やってることは同じ。
session()
は session クラスのラッパー関数。
sessionクラスのメソッドは以下。
REM Composer Ver 1.9.1 | |
REM https://getcomposer.org/download/ | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php | |
php -r "unlink('composer-setup.php');" |
<script> | |
/* | |
* Laravel 5.4 の routes/api.php に書かれているルーティングにアクセスする。 | |
* | |
* Laravel-mixで導入される通信ライブラリ「axios」を使ったサンプル。 | |
* [axios] https://github.com/mzabriskie/axios | |
* | |
* apiにアクセスする場合はユーザー(usersテーブル)のapi_tokenの値が必要になる。 | |
*/ |
<?php | |
/* | |
* PHP の static の挙動確認 | |
*/ | |
class A { | |
public static function get_self() { | |
return new self(); | |
} | |
public static function get_static() { | |
return new static(); |
<?php | |
/* | |
* Classのstaticの挙動確認 | |
* | |
*/ | |
/* | |
* static を使ったクラスのルール。 | |
* |
<?php | |
/** | |
* PHPのClass | |
*/ | |
class PhpClass | |
{ | |
/* | |
* プロパティ | |
*/ | |
public $public_property = 'public_property'; |
コントローラー内とビュー内で使い方が少々違うのだが、やってることは同じ。
session()
は session クラスのラッパー関数。
sessionクラスのメソッドは以下。
# | |
# url rewrite | |
# | |
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
# | |
# [Apache]ディレクトリにはスラッシュを付けるmod_dirの挙動 |