{"id":2867,"date":"2018-12-13T04:56:11","date_gmt":"2018-12-12T19:56:11","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2867"},"modified":"2018-12-13T04:56:11","modified_gmt":"2018-12-12T19:56:11","slug":"laravel%e3%81%ae%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%81%a7wordpress%e3%81%b8%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%a7%e3%81%8d%e3%82%8b%e3%82%88%e3%81%86%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2867","title":{"rendered":"Laravel\u306e\u30e6\u30fc\u30b6\u30fc\u3067wordpress\u3078\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5916\u89b3\u3092\u307f\u3066\u3044\u305f\u3060\u304f\u3068\u5206\u304b\u308b\u4eba\u306b\u306f\u3059\u3050\u5206\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u30d6\u30ed\u30b0\u306f<code>wordpress<\/code>\u3067\u904b\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u73fe\u5728\u3001<code>wordpress<\/code>\u306fCMS\uff08\u904b\u55b6\u8005\u81ea\u8eab\u304c\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30b7\u30b9\u30c6\u30e0\u3002\u4f8b\u3048\u3070\u30d6\u30ed\u30b0\uff09\u3067\u306f\u5727\u5012\u7684\u306b\u30b7\u30a7\u30a2\u3092\u7372\u5f97\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3082\u3057\u304b\u3059\u308b\u3068\u7686\u3055\u3093\u3082\u904e\u53bb\u306b\u4e00\u5ea6\u3050\u3089\u3044\u306f<code>wordpress<\/code>\u3067\u30d6\u30ed\u30b0\u306a\u3069\u306e\u30b5\u30a4\u30c8\u3092\u4f5c\u3063\u305f\u3053\u3068\u304c\u3042\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3055\u3066\u3001\u305d\u3093\u306a<code>wordpress<\/code>\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u3082Laravel\u3068\u540c\u3058\u304f\u30ed\u30b0\u30a4\u30f3\u304b\u3089\u8a18\u4e8b\u306e\u7ba1\u7406\u307e\u3067\u6570\u591a\u304f\u306e\u6a5f\u80fd\u3092\u521d\u671f\u72b6\u614b\u3067\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3060\u304b\u3089\u3053\u305d\u300c\u3042\u308b\u6a5f\u80fd\u300d\u3092\u3064\u304f\u308d\u3046\u3068\u3059\u308b\u3068\u3042\u308b\u554f\u984c\u304c\u8d77\u304d\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u554f\u984c\u70b9\u3068\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u4ed6\u306e\u30b5\u30a4\u30c8\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u306e\u7d71\u5408\u304c\u96e3\u3057\u3044\u3068\u3044\u3046\u70b9\u3067\u3059\u3002\uff08\u3053\u308c\u306f<code>wordpress<\/code>\u3060\u3051\u3067\u306f\u306a\u304f\u3001<code>Laravel<\/code>\u3082\u305d\u3046\u3067\u3059\uff09<\/p>\n<p>\u305d\u3053\u3067\uff01<\/p>\n<p>\u4eca\u56de\u306fLaravel\u3067\u767b\u9332\u3055\u308c\u305f\u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u3092\u4f7f\u3063\u3066<code>wordpress<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2597 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2.png\" alt=\"\" width=\"275\" height=\"350\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2.png 275w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2-236x300.png 236w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/p>\n<p>\u203b \u958b\u767a\u74b0\u5883\uff1a Laravel 5.7\u3001wordpress 5.0<\/p>\n<h1>\u524d\u63d0\u6761\u4ef6<\/h1>\n<p>\u307e\u305a\u3001Laravel\u306b\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u3066\u3001\u3055\u3089\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2868\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_1.png\" alt=\"\" width=\"711\" height=\"330\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_1.png 711w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_1-300x139.png 300w\" sizes=\"auto, (max-width: 711px) 100vw, 711px\" \/><\/p>\n<p>\u3082\u3057\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=289\">\u3010Laravel5.6\u3011\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u76f4\u5f8c\u306b\u3084\u308b\u3053\u3068\uff13\u70b9<\/a>\u306e\u300c\u30ed\u30b0\u30a4\u30f3\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30de\u30a4\u30f3\u30c0\u30fc\u6a5f\u80fd\u3092\u69cb\u7bc9\u300d\u3092\u53c2\u8003\u306b\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001<code>wordpress<\/code>\u306f<code>Laravel<\/code>\u3068\u540c\u3058\u30b5\u30fc\u30d0\u30fc\u306e\u4e2d\u306b\u3042\u308b\uff08\u3064\u307e\u308a<code>wordpress<\/code>\u304b\u3089<code>Laravel<\/code>\u306eDB\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\uff09\u3082\u306e\u3068\u3057\u307e\u3059\u3002<\/p>\n<h1>\u30ed\u30b0\u30a4\u30f3\u3092\u5b9f\u884c\u3059\u308b\u624b\u9806<\/h1>\n<p>\u5b9f\u884c\u624b\u9806\u3068\u3057\u3066\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>wordpress\u30ed\u30b0\u30a4\u30f3\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u30ed\u30b0\u30a4\u30f3\u3059\u308b<\/li>\n<li>Laravel\u5074\u306eDB\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97<\/li>\n<li>wordpress\u306b\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070Laravel\u306e\u60c5\u5831\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u767b\u9332\u3057\u3001\u3059\u3067\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308c\u3070\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u66f4\u65b0\u3059\u308b<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b<code>wordpress<\/code>\u306b\u300c<strong>laravel-authentication<\/strong>\u300d\u3068\u3044\u3046\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u958b\u767a\u3092\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u3064\u304f\u308b<\/h1>\n<h2>\u30d7\u30e9\u30b0\u30a4\u30f3\u958b\u767a\u306e\u6e96\u5099\u3092\u3059\u308b<\/h2>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u958b\u767a\u6e96\u5099\u3092\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code>wordpress<\/code>\u306b\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001<code>wp-content\/plugins<\/code>\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306b\u65b0\u3057\u304f\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3001\u305d\u3053\u306b\u540c\u540d\u306ephp\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f<code>laravel-authentication<\/code>\u3067\u3059\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2870\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_3.png\" alt=\"\" width=\"304\" height=\"191\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_3.png 304w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_3-300x188.png 300w\" sizes=\"auto, (max-width: 304px) 100vw, 304px\" \/><\/p>\n<h2>Laravel\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306e\u30e1\u30a4\u30f3\u306e\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u307e\u305a\u306f\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u304b\u3089\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;?php\r\n\/*\r\nPlugin Name: Laravel Authentication\r\nDescription: A plugin that allows to authenticate by Laravel users.\r\nVersion: 1.0.0\r\nAuthor: Sukohi Kuhoh\r\nAuthor URI: https:\/\/blog.capilano-fw.com\r\n*\/\r\n\r\n\/\/ Laravel\u306eDB\u60c5\u5831\r\n<strong>define('LARAVEL_DB_TYPE', 'mysql');<\/strong>\r\n<strong>define('LARAVEL_DB_HOST', 'localhost');<\/strong>\r\n<strong>define('LARAVEL_DB_PORT', '3306');<\/strong>\r\n<strong>define('LARAVEL_DB_DATABASE', 'YOUR-LARAVEL-DB-NAME');<\/strong>\r\n<strong>define('LARAVEL_DB_USERNAME', 'YOUR-USER-NAME');<\/strong>\r\n<strong>define('LARAVEL_DB_PASSWORD', 'YOUR-PASSWORD');<\/strong>\r\n<strong>define('LARAVEL_DB_USER_TABLE', 'users'); \/\/ \u540d\u524d\u304c\u9055\u3046\u5834\u5408\u306f\u5909\u3048\u3066\u304f\u3060\u3055\u3044<\/strong>\r\n\r\n\/\/ \u30a2\u30af\u30b7\u30e7\u30f3\u8ffd\u52a0\r\n<strong>add_action('wp_authenticate', 'laravel_authenticate', 30, 2);<\/strong>\r\n\r\nfunction laravel_authenticate($username, $password) {\r\n\r\n    \/\/ DB\u63a5\u7d9a\r\n    try {\r\n\r\n        <strong>$pdo = new PDO(\r\n            LARAVEL_DB_TYPE .':'.\r\n                'host='. LARAVEL_DB_HOST .';'.\r\n                'port='. LARAVEL_DB_PORT .';'.\r\n                'dbname='. LARAVEL_DB_DATABASE .';'.\r\n                'charset=utf8mb4', \/\/ DSN\r\n            LARAVEL_DB_USERNAME,\r\n            LARAVEL_DB_PASSWORD\r\n        );<\/strong>\r\n\r\n    } catch (Exception $e) {\r\n\r\n        return;\r\n\r\n    }\r\n\r\n    \/\/ Laravel\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97\r\n    <strong>$sql = $pdo-&gt;prepare('SELECT name,email,password FROM '. LARAVEL_DB_USER_TABLE .' WHERE email=:email');<\/strong>\r\n<strong>    $sql-&gt;bindParam(':email', $username);<\/strong>\r\n<strong>    $sql-&gt;execute();<\/strong>\r\n<strong>    $laravel_user = $sql-&gt;fetch();<\/strong>\r\n\r\n    \/\/ Laravel\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u5834\u5408\r\n    if($laravel_user) {\r\n\r\n        $laravel_name = $laravel_user['name'];\r\n        $laravel_email = $laravel_user['email'];\r\n        $laravel_password = $laravel_user['password'];\r\n\r\n        \/\/ Laravel\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30c1\u30a7\u30c3\u30af\r\n        <strong>if(password_verify($password, $laravel_password)) {<\/strong>\r\n\r\n<strong>            $wp_user = get_user_by('email', $laravel_email);<\/strong>\r\n\r\n<strong>            if(!$wp_user) { \/\/ \u30e6\u30fc\u30b6\u30fc\u767b\u9332<\/strong>\r\n\r\n<strong>                wp_insert_user([<\/strong>\r\n<strong>                    'user_login' =&gt; md5(uniqid(rand(), 1)),<\/strong>\r\n<strong>                    'user_pass' =&gt; $password,<\/strong>\r\n<strong>                    'user_email' =&gt; $laravel_email,<\/strong>\r\n<strong>                    'display_name' =&gt; $laravel_name,<\/strong>\r\n<strong>                    'role' =&gt; 'author'<\/strong>\r\n<strong>                ]);<\/strong>\r\n\r\n<strong>            } else { \/\/ \u30e6\u30fc\u30b6\u30fc\u66f4\u65b0<\/strong>\r\n\r\n<strong>                wp_update_user([<\/strong>\r\n<strong>                    'ID' =&gt; $wp_user-&gt;ID,<\/strong>\r\n<strong>                    'user_pass' =&gt; $password,<\/strong>\r\n<strong>                    'user_email' =&gt; $laravel_email,<\/strong>\r\n<strong>                    'display_name' =&gt; $laravel_name<\/strong>\r\n<strong>                ]);<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n    }\r\n\r\n}<\/pre>\n<p>\u3067\u306f\u3072\u3068\u3064\u305a\u3064\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30d7\u30e9\u30b0\u30a4\u30f3\u60c5\u5831<\/h3>\n<p>\u307e\u305a\u4e00\u756a\u4e0a\u306e\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u305f\u90e8\u5206\u3002<br \/>\n\u3053\u3053\u306b\u66f8\u3044\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u60c5\u5831\u304c<code>wordpress<\/code>\u3067\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>Laravel\u306eDB\u60c5\u5831<\/h3>\n<p>Laravel\u5074\u306eDB\u3078\u63a5\u7d9a\u3059\u308b\u60c5\u5831\u3067\u3059\u3002<br \/>\n\u3059\u3067\u306b\u30b5\u30a4\u30c8\u304c\u3042\u308b\u306e\u306a\u3089\u3001<code>.env<\/code>\u304b\u3089\u60c5\u5831\u3092\u5199\u3059\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u306e\u540d\u524d\u304c\u4f8b\u3048\u3070\u3001<code>lv_users<\/code>\u306a\u3069\u306e\u3088\u3046\u306b\u901a\u5e38\u306e\u3082\u306e\u3068\u7570\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u306f<code>LARAVEL_DB_USER_TABLE<\/code>\u3092\u5909\u66f4\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30a2\u30af\u30b7\u30e7\u30f3\u8ffd\u52a0<\/h3>\n<p>wordpress\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308b<code>add_action()<\/code>\u3092\u4f7f\u3063\u3066\u30ed\u30b0\u30a4\u30f3\u6642\u306b<code>laravel_authenticate()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>DB\u63a5\u7d9a<\/h3>\n<p>\u4eca\u56de\u306f<code>PDO<\/code>\u3092\u4f7f\u3063\u3066DB\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001\u65e5\u672c\u8a9e\u3092\u5229\u7528\u3057\u305f\u3044\u5834\u5408\u306f<code>charset<\/code>\u3092Laravel\u3068\u540c\u3058\u304f<code>utf8mb4<\/code>\u306a\u3069\u306b\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u6587\u5b57\u5316\u3051\u306e\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>Laravel\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97<\/h3>\n<p>\u500b\u4eba\u7684\u306b\u306f\u305d\u306e\u6614\u826f\u304f\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f<code>Laravel<\/code>\u306e<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u4e00\u81f4\u3059\u308b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u53d6\u5f97\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u6b21\u306e\uff13\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>name<\/li>\n<li>email<\/li>\n<li>password<\/li>\n<\/ul>\n<h3>Laravel\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30c1\u30a7\u30c3\u30af<\/h3>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057<code>Laravel<\/code>\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u898b\u3064\u304b\u3063\u305f\u5834\u5408\u3001\u305d\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u672c\u5f53\u306b\u6b63\u3057\u3044\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u306b\u3001PHP\u95a2\u6570\u306e<code>password_verify()<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002\uff08Laravel\u3082\u5185\u90e8\u7684\u306b\u3053\u306e\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\uff09<\/p>\n<h3>\u30e6\u30fc\u30b6\u30fc\u767b\u9332 or \u30e6\u30fc\u30b6\u30fc\u66f4\u65b0<\/h3>\n<p>\u3082\u3057\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30c1\u30a7\u30c3\u30af\u3082\u554f\u984c\u304c\u306a\u3051\u308c\u3070\u4eca\u5ea6\u306f<code>wordpress<\/code>\u5074\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u6b21\u306e\uff12\u30d1\u30bf\u30fc\u30f3\u3067\u51e6\u7406\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>wordpress\u306b\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u3000\u30fb\u30fb\u30fb\u3000\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332<\/li>\n<li>\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u3000\u30fb\u30fb\u30fb\u3000\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092Laravel\u306b\u767b\u9332\u3055\u308c\u305f\u3082\u306e\u306b\u66f4\u65b0<\/li>\n<\/ul>\n<p>\u306a\u304a\u3001<code>role<\/code>\u306f\u6a29\u9650\u306e\u3072\u3068\u3064\u3067\u3001\u4eca\u56de\u306f\u81ea\u5206\u306e\u8a18\u4e8b\u3092\u6295\u7a3f\u3001\u7de8\u96c6\u3001\u516c\u958b\u304c\u3067\u304d\u308b<code>author<\/code>\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u306a\u308b<code>user_login<\/code>\u306f\u4eca\u56de<code>Laravel<\/code>\u5074\u306b\u306f\u5b58\u5728\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u3092\u3064\u3051\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3082\u3057<code>Laravel<\/code>\u5074\u306b\u3082\u82f1\u6570\u5b57\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u3042\u308b\u306e\u3067\u3057\u305f\u3089\u305d\u308c\u3092\u4f7f\u3046\u306e\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\uff08\u305f\u3060\u3057\u3001\u4e00\u610f\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<h1>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u6709\u52b9\u306b\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30b3\u30fc\u30c9\u306f\u5b8c\u4e86\u3057\u305f\u306e\u3067\u3001<code>wordpress<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066<code>laravel-authentication<\/code>\u3092\u6709\u52b9\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2873\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_4.png\" alt=\"\" width=\"807\" height=\"262\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_4.png 807w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_4-300x97.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_4-768x249.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u30da\u30fc\u30b8\u5de6\u5074\u306e\u300c\u30d7\u30e9\u30b0\u30a4\u30f3\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u8868\u793a\u3055\u308c\u305f<code>Laravel Authentication<\/code>\u306e<strong>\u6709\u52b9\u5316<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\uff01<\/p>\n<h1>\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u6e96\u5099\u306f\u3059\u3079\u3066\u5b8c\u4e86\u3057\u305f\u306e\u3067\u3001\u5b9f\u969b\u306bLaravel\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u73fe\u5728\u306e<code>wordpress<\/code>\u5074\u306e\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2874\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_5.png\" alt=\"\" width=\"694\" height=\"324\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_5.png 694w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_5-300x140.png 300w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/p>\n<p>\u307e\u3060\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3070\u304b\u308a\u306a\u306e\u3067\u3001\u7ba1\u7406\u8005\u30c7\u30fc\u30bf\u3060\u3051\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2875\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_6.png\" alt=\"\" width=\"349\" height=\"387\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_6.png 349w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_6-271x300.png 271w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<p>\u3067\u306f\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u304b\u3089\u300c\u592a\u90ce\u300d\u3055\u3093\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2876\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_7.png\" alt=\"\" width=\"1280\" height=\"721\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_7.png 1280w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_7-300x169.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_7-768x433.png 768w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_7-1024x577.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u3046\u307e\u304f\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2877\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_9.png\" alt=\"\" width=\"229\" height=\"69\" \/><\/p>\n<p>\u30da\u30fc\u30b8\u53f3\u4e0a\u306b\u306fLaravel\u5074\u3067\u767b\u9332\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2878\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_8.png\" alt=\"\" width=\"160\" height=\"271\" \/><\/p>\n<p>\u306a\u304a\u3001\u300c\u592a\u90ce\u300d\u3055\u3093\u306f<code>author<\/code>\u3068\u3057\u3066\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30da\u30fc\u30b8\u5de6\u5074\u306b\u30d7\u30e9\u30b0\u30a4\u30f3\u306a\u3069\u306e\u8a2d\u5b9a\u30da\u30fc\u30b8\u304c\u5b58\u5728\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u6642\u70b9\u3067DB\u30c6\u30fc\u30d6\u30eb\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2879\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_10.png\" alt=\"\" width=\"952\" height=\"305\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_10.png 952w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_10-300x96.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/laravel_user_wordpress_10-768x246.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff01<\/p>\n<h1>\u3061\u306a\u307f\u306b<\/h1>\n<p>\u4eca\u56de\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066<code>wordpress<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u5f8c\u3001\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u30da\u30fc\u30b8\u306a\u3069\u304b\u3089\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5909\u66f4\u3084\u3001\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u306f\u6a5f\u80fd\u3057\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u6df7\u4e71\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u3001\u305d\u308c\u3089\u306e\u8868\u793a\u306f\u6d88\u3057\u3066\u304a\u3044\u305f\u307b\u3046\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305f\u3001Laravel\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u63a5\u7d9a\u60c5\u5831\u306f\u76f4\u63a5\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e2d\u306b\u66f8\u304b\u305a<code>wp-config.php<\/code>\u306a\u3069\u306b\u66f8\u3044\u3066\u304a\u304f\u307b\u3046\u304c\u4fdd\u5b88\u3057\u3084\u3059\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3053\u308c\u307e\u3067<code>wordpress<\/code>\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u3063\u305f\u3053\u3068\u306f\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u30d5\u30a9\u30eb\u30c0\u3092\u7528\u610f\u3059\u308b\u3060\u3051\u3067\u4f5c\u308c\u308b\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3054\u304f\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e2d\u3067\u3082<code>wordpress<\/code>\u304c\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u6570\u3005\u306e\u95a2\u6570\u3092\u4f7f\u3048\u308b\u306e\u306f\u3068\u3066\u3082\u9b45\u529b\u7684\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u8a18\u4e8b\u306e\u4e2d\u3067\u3082\u5c11\u3057\u8a00\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u4e45\u3057\u3076\u308a\u306b\u904e\u53bb\u306b\u3088\u304f\u4f7f\u3063\u3066\u3044\u305f\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3001<code>Laravel<\/code>\u304c\u3044\u304b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3084\u3059\u3044\u304b\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u7279\u306b<code>PDO<\/code>\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u3002<br \/>\n\u3053\u308c\u306f<code>wordpress<\/code>\u3067\u306f\u306a\u304f\u7d14\u7c8b\u306aPHP\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001\u3067\u304d\u308c\u3070\u3042\u307e\u308a\u3082\u3046\u4f7f\u3044\u305f\u3044\u3068\u306f\u601d\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002^^;<\/p>\n<p>\u305d\u3046\u3044\u3048\u3070\u3082\u3063\u3068\u6614\u306f\u3001Pear\u3068\u304b\u4f7f\u3063\u3066\u305f\u3051\u3069\u3042\u308c\u3063\u3066\u3069\u3046\u306a\u3063\u305f\u3093\u3067\u3057\u3087\u3046\u306d\uff1f\uff1f<\/p>\n<p>\u3068\u3044\u3063\u305f\u3068\u3053\u308d\u3067\u4eca\u56de\u306f\u7d42\u4e86\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1785 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/10\/15-2.png\" alt=\"\" width=\"226\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/10\/15-2.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/10\/15-2-212x300.png 212w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5916\u89b3\u3092\u307f\u3066\u3044\u305f\u3060\u304f\u3068\u5206\u304b\u308b\u4eba\u306b\u306f\u3059\u3050\u5206\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u30d6\u30ed\u30b0\u306fwordpress\u3067\u904b\u7528\u3057\u3066\u3044\u307e\u3059\u3002 \u73fe\u5728\u3001wordpress\u306fCMS\uff08\u904b\u55b6\u8005\u81ea\u8eab &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2867\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel\u306e\u30e6\u30fc\u30b6\u30fc\u3067wordpress\u3078\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2882,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,59],"tags":[58],"class_list":["post-2867","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-wordpress","tag-58"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2867"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2867\/revisions"}],"predecessor-version":[{"id":2888,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2867\/revisions\/2888"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2882"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}