{"id":5226,"date":"2019-12-07T02:47:04","date_gmt":"2019-12-06T17:47:04","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=5226"},"modified":"2021-01-12T04:45:46","modified_gmt":"2021-01-11T19:45:46","slug":"%e8%87%aa%e5%8b%95%e5%8c%96%ef%bc%81laravel%e3%81%ab%e3%83%87%e3%83%bc%e3%82%bf%e7%99%bb%e9%8c%b2%e3%81%95%e3%82%8c%e3%81%9f%e3%82%89twitter%e3%81%ab%e6%8a%95%e7%a8%bf%e3%81%99%e3%82%8b%ef%bc%88","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=5226","title":{"rendered":"Laravel\u3067Twitter\u6295\u7a3f\uff08\u753b\u50cf\u3064\u304d\uff09\u3010\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\u3011"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u30fb\u524d\u3005\u56de\u3068\u753b\u50cf\u306b\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u3092<code>Laravel<\/code>\u3067\u958b\u767a\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u753b\u50cf\u95a2\u9023\u3067\u4ed6\u306b\u3082\u4f55\u304b\u304a\u5c4a\u3051\u3067\u304d\u308b\u5185\u5bb9\u304c\u306a\u3044\u304b\u3068\u8003\u3048\u3066\u3044\u305f\u3068\u3053\u308d\u3001\u753b\u50cf\u304c\u30e1\u30a4\u30f3\u3068\u3044\u3046\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u3072\u3068\u3064\u3042\u308b\u30a2\u30a4\u30c7\u30a2\u304c\u6d6e\u304b\u3093\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u304c\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">Laravel\u304b\u3089Twitter\u6295\u7a3f\u3059\u308b\uff08\u753b\u50cf\u3064\u304d\uff09<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u306f\u4ee5\u524d<code>PHP<\/code>\u304b\u3089\u30c4\u30a4\u30c3\u30bf\u30fc\u6295\u7a3f\u3059\u308b\u6a5f\u80fd\u3092\u958b\u767a\u3057\u305f\u3053\u3068\u304c\u3042\u3063\u305f\u3093\u3067\u3059\u304c\u3001\u305d\u308c\u306f\u753b\u50cf\u306a\u3057\u306e\u30c6\u30ad\u30b9\u30c8\u30fb\u30aa\u30f3\u30ea\u30fc\u3067\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306f\u3061\u3087\u3046\u3069\u3044\u3044\u6d41\u308c\u306a\u306e\u3067\u30b5\u30a4\u30c8\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u81ea\u52d5\u7684\u306b<code>Twitter<\/code>\u306b\u6295\u7a3f\u304c\u3067\u304d\u308b\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 5.8\u3001Vue 2.6<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u958b\u767a\u3059\u308b\u5177\u4f53\u7684\u306a\u6a5f\u80fd\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u5546\u54c1\u60c5\u5831\u3092DB\u306b\u767b\u9332\u3059\u308b<\/li>\n<li>\u767b\u9332\u3055\u308c\u305f\u3089\u81ea\u52d5\u7684\u306b\u30c4\u30a4\u30c3\u30bf\u30fc\u306b\u300c\u65b0\u7740\u300d\u3068\u3057\u3066\u6295\u7a3f<\/li>\n<\/ol>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4eca\u65e5\u3082 Let&#8217;s Code!<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p>\u4eca\u56de\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u305f\u3081\u306b\u306f\u3001<code>Twitter<\/code>\u3067API\u30ad\u30fc\u3068\u30a2\u30af\u30bb\u30b9\u30fb\u30c8\u30fc\u30af\u30f3\u3092\u3064\u304f\u3063\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u307e\u3060\u4f5c\u6210\u3057\u3066\u3044\u306a\u3044\u65b9\u306f\u3001<a href=\"#api_key_n_access_token\">\u30c4\u30a4\u30c3\u30bf\u30fc\u3067API\u30ad\u30fc\u3068\u30a2\u30af\u30bb\u30b9\u30fb\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3059\u308b<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u5148\u306b\u3053\u308c\u3089\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>Laravel\u5074\u306e\u4f5c\u696d<\/h1>\n<h2>API\u30ad\u30fc\uff06\u30a2\u30af\u30bb\u30b9\u30fb\u30c8\u30fc\u30af\u30f3\u3092\u30bb\u30c3\u30c8\u3059\u308b<\/h2>\n<p>\u53d6\u5f97\u3057\u305fAPI\u30ad\u30fc\u3068\u30a2\u30af\u30bb\u30b9\u30fb\u30c8\u30fc\u30af\u30f3\u306f<code>.env<\/code>\u5185\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u8fbc\u3093\u3067\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>TWITTER_CONSUMER_KEY=\uff08\"API key\" \u306e\u5185\u5bb9\uff09\r\nTWITTER_CONSUMER_SECRET=\uff08\"API secret key\" \u306e\u5185\u5bb9\uff09\r\nTWITTER_ACCESS_TOKEN=\uff08\"Access token\" \u306e\u5185\u5bb9\uff09\r\nTWITTER_ACCESS_SECRET=\uff08\"Access token secret\" \u306e\u5185\u5bb9\uff09<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u3053\u308c\u3089\u306e\u60c5\u5831\u3092<code>config()<\/code>\u3067\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046<code>config\/services.php<\/code>\u3092\u958b\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nreturn [\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n<strong>    'twitter' =&gt; [<\/strong>\r\n<strong>        'consumer_key'    =&gt; env('TWITTER_CONSUMER_KEY'),<\/strong>\r\n<strong>        'consumer_secret' =&gt; env('TWITTER_CONSUMER_SECRET'),<\/strong>\r\n<strong>        'access_token'    =&gt; env('TWITTER_ACCESS_TOKEN'),<\/strong>\r\n<strong>        'access_secret'   =&gt; env('TWITTER_ACCESS_SECRET')<\/strong>\r\n<strong>    ]<\/strong>\r\n\r\n];<\/pre>\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p>\u4eca\u56de\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>composer require laravel-notification-channels\/twitter<\/strong><\/pre>\n<pre><strong>composer require sukohi\/clamp-bolt:4.*<\/strong><\/pre>\n<p>\uff08\u3061\u306a\u307f\u306b\uff12\u3064\u76ee\u306f\u79c1\u304c<a href=\"https:\/\/github.com\/SUKOHI\/ClampBolt\" target=\"_blank\" rel=\"noopener noreferrer\">\u516c\u958b\u3057\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8<\/a>\u3067\u3001\u4fdd\u5b58\u753b\u50cf\u3068DB\u30c7\u30fc\u30bf\u3092\u7e4b\u3052\u3066\u7ba1\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\uff09<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u7528\u306eDB\u30c6\u30fc\u30d6\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan vendor:publish --provider=\"Sukohi\\ClampBolt\\ClampBoltServiceProvider\"<\/strong><\/pre>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u4f5c\u6210\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u3053\u306b\u4eca\u56de\u306f\u753b\u50cf\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5246\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_18.png\" alt=\"\" width=\"347\" height=\"399\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_18.png 347w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_18-261x300.png 261w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/p>\n<h2>\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306f<code>products<\/code>\u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u306b\u5546\u54c1\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3057\u3066\u3044\u304d\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model Product -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068<code>app\/Product.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u753b\u50cf\u3082\u7ba1\u7406\u3067\u304d\u308b\u3088\u3046\u306b<code>ClampBoltTrait<\/code>\u3092\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n<strong>use Sukohi\\ClampBolt\\ClampBoltTrait;<\/strong>\r\n\r\nclass Product extends Model\r\n{\r\n    <strong>use ClampBoltTrait;<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001<code>database\/migrations\/****_**_**_******_create_products_table.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3082\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002\uff08<strong>\u592a\u5b57<\/strong>\u304c\u8ffd\u52a0\u3057\u3066\u3068\u3053\u308d\u3067\u3059\uff09<\/p>\n<pre>&lt;?php\r\n\r\nuse Illuminate\\Support\\Facades\\Schema;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\n\r\nclass CreateProductsTable extends Migration\r\n{\r\n    \/**\r\n     * Run the migrations.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function up()\r\n    {\r\n        Schema::create('products', function (Blueprint $table) {\r\n            $table-&gt;bigIncrements('id');\r\n            <strong>$table-&gt;string('name')-&gt;comment('\u5546\u54c1\u540d');<\/strong>\r\n<strong>            $table-&gt;unsignedInteger('price')-&gt;comment('\u4fa1\u683c');<\/strong>\r\n            $table-&gt;timestamps();\r\n        });\r\n    }\r\n\r\n    \/**\r\n     * Reverse the migrations.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function down()\r\n    {\r\n        Schema::dropIfExists('products');\r\n    }\r\n}<\/pre>\n<p>\u5909\u66f4\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068DB\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5244\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_17.png\" alt=\"\" width=\"353\" height=\"255\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_17.png 353w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_17-300x217.png 300w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/p>\n<h2>Notification\u3092\u3064\u304f\u308b<\/h2>\n<p>\u5148\u307b\u3069\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d1\u30c3\u30b1\u30fc\u30b8<code>laravel-notification-channels\/twitter<\/code>\u306f<code>Laravel<\/code>\u304c\u63d0\u4f9b\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u6a5f\u80fd<code>Notification<\/code>\u3092\u4f7f\u3063\u3066\u5b9f\u88c5\u3057\u307e\u3059\u306e\u3067\u3001\u5c02\u7528\u306e<code>NewProductArrived<\/code>\u3068\u3044\u3046<code>Notification<\/code>\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:notification NewProductArrived<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>app\/Notifications\/NewProductArrived.php<\/code>\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u958b\u3044\u3066\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Notifications;\r\n\r\nuse App\\Product;\r\nuse Illuminate\\Notifications\\Notification;\r\nuse NotificationChannels\\Twitter\\TwitterChannel;\r\nuse NotificationChannels\\Twitter\\TwitterStatusUpdate;\r\n\r\nclass NewProductArrived extends Notification\r\n{\r\n    private $product;\r\n\r\n    public function __construct(Product $product)\r\n    {\r\n        $this-&gt;product = $product;\r\n    }\r\n\r\n    <strong>public function via($notifiable)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return [TwitterChannel::class];<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function toTwitter($notifiable)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $text = \"\u65b0\u7740\uff01\\n\u3010\". $this-&gt;product-&gt;name .\"\u3011\u3068\u3044\u3046\u5546\u54c1\u304c\u767b\u9332\u3055\u308c\u307e\u3057\u305f\\n\".<\/strong>\r\n<strong>                url('product\/'. $this-&gt;product-&gt;id);<\/strong>\r\n<strong>        $attachment = $this-&gt;product-&gt;getAttachment('product_image');<\/strong>\r\n<strong>        return (new TwitterStatusUpdate($text))-&gt;withImage($attachment-&gt;path);<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<h2>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001\u30eb\u30fc\u30c8\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u3092<code>routes\/web.php<\/code>\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>Route::get('product\/create', 'ProductController@create');<\/strong>\r\n<strong>Route::post('product', 'ProductController@store');<\/strong>  \/\/ Ajax<\/pre>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6b21\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<br \/>\n\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller ProductController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>app\/Http\/Controllers\/ProductController.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse App\\Notifications\\NewProductArrived;\r\nuse Illuminate\\Http\\Request;\r\nuse NotificationChannels\\Twitter\\TwitterChannel;\r\n\r\nclass ProductController extends Controller\r\n{\r\n    <strong>public function create() {<\/strong>\r\n\r\n<strong>        return view('product.create');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n    <strong>public function store(Request $request) {<\/strong>\r\n\r\n<strong>        $request-&gt;validate([<\/strong>\r\n<strong>            'name' =&gt; 'required|string',<\/strong>\r\n<strong>            'price' =&gt; 'required|integer|min:0',<\/strong>\r\n<strong>            'image' =&gt; 'required|image'<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        $product = new \\App\\Product();<\/strong>\r\n<strong>        $product-&gt;name = $request-&gt;name;<\/strong>\r\n<strong>        $product-&gt;price = $request-&gt;price;<\/strong>\r\n<strong>        $product-&gt;attach('product_image', $request-&gt;image);<\/strong>\r\n<strong>        $result = $product-&gt;save();<\/strong>\r\n\r\n<strong>        \/\/ \u30c4\u30a4\u30c3\u30bf\u30fc\u306b\u6295\u7a3f<\/strong>\r\n<strong>        \\Notification::route(TwitterChannel::class, '')-&gt;notify(new NewProductArrived($product));<\/strong>\r\n\r\n<strong>        return ['result' =&gt; $result];<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p><code>create()<\/code>\u304c\u5546\u54c1\u306e\u767b\u9332\u30d5\u30a9\u30fc\u30e0\u3067\u3001<code>store()<\/code>\u304c<code>Ajax<\/code>\u3067\u767b\u9332\u60c5\u5831\u3068\u753b\u50cf\u3092\u53d7\u3051\u53d6\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<p><code>store()<\/code>\u306e\u4e2d\u3067\u306f\u3001<code>products<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u65b0\u3057\u3044\u5546\u54c1\u3092\u8ffd\u52a0\u3057\u3001<code>attach()<\/code>\u3067\u753b\u50cf\u306e\u30c7\u30fc\u30bf\u3092<code>attachments<\/code>\u306b\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4fdd\u5b58\u304c\u5b8c\u4e86\u3057\u305f\u3089<code>NewProductArrived()<\/code>\u3092\u547c\u3073\u51fa\u3057\u3066\u305d\u306e\u60c5\u5831\u3092\u5143\u306b\u30c4\u30a4\u30c3\u30bf\u30fc\u6295\u7a3f\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h2>\n<p>\u305d\u3057\u3066\u3001\u5546\u54c1\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n<code>resources\/views\/product\/create.blade.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u3063\u3066\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body class=\"p-4\"&gt;\r\n&lt;div id=\"app\" class=\"container\"&gt;\r\n    &lt;div class=\"row\"&gt;\r\n        &lt;div class=\"col-4\"&gt;\r\n            &lt;div class=\"form-group\"&gt;\r\n                &lt;label&gt;\u5546\u54c1\u540d&lt;\/label&gt;\r\n                &lt;input class=\"form-control\" type=\"text\" v-model=\"name\"&gt;\r\n                &lt;div class=\"text-danger\" v-if=\"errors.name\" v-text=\"errors.name\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n            &lt;div class=\"form-group\"&gt;\r\n                &lt;label&gt;\u4fa1\u683c&lt;\/label&gt;\r\n                &lt;input class=\"form-control\" type=\"text\" v-model=\"price\"&gt;\r\n                &lt;div class=\"text-danger\" v-if=\"errors.price\" v-text=\"errors.price\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n            &lt;div class=\"form-group\"&gt;\r\n                &lt;label&gt;\u753b\u50cf&lt;\/label&gt;\r\n                &lt;input class=\"form-control\" type=\"file\" accept=\"image\/*\" <strong>@change=\"onFileChange\"<\/strong>&gt;\r\n                &lt;div class=\"text-danger\" v-if=\"errors.image\" v-text=\"errors.image\"&gt;&lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n            &lt;button class=\"btn btn-primary\" type=\"button\" <strong>@click=\"onSubmit\"<\/strong>&gt;\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b&lt;\/button&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.0\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.0\/axios.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n\r\n    new Vue({\r\n        el: '#app',\r\n        data: {\r\n            name: '',\r\n            price: 0,\r\n            imageFile: null,\r\n            errors: {\r\n                name: '',\r\n                price: '',\r\n                image: ''\r\n            }\r\n        },\r\n        methods: {\r\n            <strong>onFileChange(e) {\r\n\r\n                \/\/ \u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u3092\u5909\u6570\u3067\u4fdd\u6301\u3059\u308b\r\n                this.imageFile = e.target.files[0];\r\n\r\n            },\r\n            onSubmit() {\r\n\r\n                \/\/ \u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\r\n                const url = '\/product';\r\n                let formData = new FormData();\r\n                formData.append('name', this.name);\r\n                formData.append('price', this.price);\r\n                formData.append('image', this.imageFile);\r\n\r\n                axios.post(url, formData)\r\n                    .then(response =&gt; {\r\n\r\n                        if(response.data.result) {\r\n\r\n                            alert('\u5546\u54c1\u767b\u9332\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002');\r\n\r\n                        }\r\n\r\n                    })\r\n                    .catch(error =&gt; {\r\n\r\n                        this.errors = {};\r\n                        const errors = error.response.data.errors;\r\n\r\n                        for(let key in errors) {\r\n\r\n                            this.errors[key] = errors[key][0];\r\n\r\n                        }\r\n\r\n                    });\r\n\r\n            }<\/strong>\r\n        }\r\n    });\r\n\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u91cd\u8981\u306a\u306e\u306f\u3001<code>onFileChange()<\/code>\u3068<code>onSubmit()<\/code>\u3067\u3059\u3002<\/p>\n<p><code>onFileChange()<\/code>\u3067\u306f\u3001\u753b\u50cf\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306b\u753b\u50cf\u30c7\u30fc\u30bf\u3092\u5909\u6570\u306b\u683c\u7d0d\u3057\u3001<code>onSubmit()<\/code>\u3067\u306f\u305d\u306e\u30c7\u30fc\u30bf\u3092\u542b\u3081\u3066\u5165\u529b\u30c7\u30fc\u30bf\u3092<code>Ajax<\/code>\u3067\u9001\u4fe1\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<code>FormData<\/code>\u3092\u4f7f\u3063\u3066\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f5c\u3063\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u30d5\u30a1\u30a4\u30eb\u30c7\u30fc\u30bf\u306e\u9001\u4fe1\u304c\u5fc5\u8981\u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u5546\u54c1\u3092\u767b\u9332\u3057\u3066\u30c4\u30a4\u30c3\u30bf\u30fc\u6295\u7a3f\u304c\u3067\u304d\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u307e\u305a\u30da\u30fc\u30b8\u3092\u958b\u3044\u3066\u5fc5\u8981\u306a\u9805\u76ee\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5248\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_19.png\" alt=\"\" width=\"402\" height=\"326\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_19.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_19-300x243.png 300w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5250\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_20.png\" alt=\"\" width=\"444\" height=\"132\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_20.png 444w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_20-300x89.png 300w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/p>\n<p>\u3067\u306f\u3001\u30c4\u30a4\u30c3\u30bf\u30fc\u306e\u65b9\u304c\u3069\u3046\u306a\u3063\u3066\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5251\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_21.png\" alt=\"\" width=\"592\" height=\"427\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_21.png 592w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_21-300x216.png 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/p>\n<p>\u306f\u3044\uff01\u3046\u307e\u304f\u753b\u50cf\u3064\u304d\u3067\u6295\u7a3f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u5b9a\u306a\u3069\u306f\u3054\u81ea\u8eab\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=5254&amp;tmstv=1777537081\" rel=\"nofollow\" id=\"download-link-5254\" data-redirect=\"false\" >\n\tLaravel\u306b\u30c7\u30fc\u30bf\u767b\u9332\u3055\u308c\u305f\u3089Twitter\u306b\u6295\u7a3f<\/a>\n\n<div id=\"api_key_n_access_token\"><\/div>\n<h1>\u30c4\u30a4\u30c3\u30bf\u30fc\u3067API\u30ad\u30fc\u3068\u30a2\u30af\u30bb\u30b9\u30fb\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3059\u308b<\/h1>\n<p><code>Laravel<\/code>\u304c<code>Twitter<\/code>\u3068\u9023\u643a\u3059\u308b\u305f\u3081\u306b\u306f\u3001<code>Twitter<\/code>\u304c\u63d0\u4f9b\u3059\u308b\u30ad\u30fc\u3068\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\uff08\u6b63\u78ba\u306b\u306f\u4ee5\u4e0b\u306e\uff14\u3064\uff09<\/p>\n<ul>\n<li>TWITTER_CONSUMER_KEY<\/li>\n<li>TWITTER_CONSUMER_SECRET<\/li>\n<li>TWITTER_ACCESS_TOKEN<\/li>\n<li>TWITTER_ACCESS_SECRET<\/li>\n<\/ul>\n<p>\u3053\u306e\u9805\u76ee\u3067\u306f\u3053\u308c\u3089\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u624b\u9806\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u203b \u3082\u3046\u3059\u3067\u306b\u30ad\u30fc\uff06\u30c8\u30fc\u30af\u30f3\u3092\u6301\u3063\u3066\u3044\u308b\u65b9\u306f\u3053\u306e\u4f5c\u696d\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n<h2>\u30c4\u30a4\u30c3\u30bf\u30fc\u306bAPI\u304c\u4f7f\u3048\u308b\u3088\u3046\u7533\u8acb\u3059\u308b<\/h2>\n<p>\u307e\u305a\u306f\u57fa\u672c\u306e\u30c4\u30a4\u30c3\u30bf\u30fc\u30fb\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u5fc5\u8981\u3067\u3059\u306e\u3067\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u6301\u3063\u3066\u3044\u306a\u3044\u4eba\u306f<a href=\"https:\/\/twitter.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u3053\u3061\u3089<\/a>\u304b\u3089\u767b\u9332\u3092\u6e08\u307e\u305b\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u767b\u9332\u304c\u6e08\u3093\u3060\u3089\u3001\u6b21\u306f\u958b\u767a\u8005\u3068\u3057\u3066\u306e\u767b\u9332\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/developer.twitter.com\/en\/apply-for-access\" target=\"_blank\" rel=\"noopener noreferrer\">Apply for access<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066<strong>\u300cApply for a developer account\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u884c\u304f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5242\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_1.png\" alt=\"\" width=\"640\" height=\"299\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_1.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_1-300x140.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u5229\u7528\u76ee\u7684\u3092\u9078\u629e\u3059\u308b\u753b\u9762\u306b\u306a\u308b\u306e\u3067\u9069\u5f53\u306b\u3054\u81ea\u8eab\u306b\u3042\u3046\u3082\u306e\u3092\u9078\u629e\u3057\u3066<strong>\u300cNext\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5241\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_2.png\" alt=\"\" width=\"640\" height=\"470\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_2-300x220.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3059\u308b\u3068\u8272\u3005\u3068\u5165\u529b\u3059\u308b\u9805\u76ee\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u5fc5\u8981\u306a\u306e\u306f\u4ee5\u4e0b\u306e\uff12\u30f6\u6240\u3060\u3051\u3067\u3059\u3002\u4f4f\u3093\u3067\u3044\u308b\u56fd\u3001\u305d\u3057\u3066\u547c\u3093\u3067\u307b\u3057\u3044\u540d\u524d\uff08\u3064\u307e\u308a\u30cb\u30c3\u30af\u30cd\u30fc\u30e0\u3084\u958b\u767a\u8005\u540d\uff09\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5240\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_3.png\" alt=\"\" width=\"640\" height=\"426\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_3-300x200.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001<strong>\u300c\u3069\u3093\u306a\u98a8\u306b\u30c4\u30a4\u30c3\u30bf\u30fcAPI\u3092\u4f7f\u3046\u306e\uff1f\uff1f\u300d<\/strong>\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u3001\uff08\u3053\u3053\u304c\u4e00\u756a\u3084\u3084\u3063\u3053\u3057\u3044\u3067\u3059\ud83d\ude2b\uff09\u305d\u308c\u305e\u308c\u306b\u300c\u82f1\u8a9e\u300d\u3067\u7b54\u3048\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u5fc5\u8981\u306a\u9805\u76ee\u306e\u56de\u7b54\u4f8b\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><strong>\uff08In your words\uff09<\/strong><\/p>\n<p>I develop features to tweet from my web applications in PHP, JavaScript, etc. using Twitter API.<br \/>\nSo we do NOT retrieve and don&#8217;t use Twitter data in the web applications.<br \/>\nThe purpose is just tweeting.<\/p>\n<p>\uff08\u548c\u8a33\uff1a \u30c4\u30a4\u30c3\u30bf\u30fcAPI\u3092\u4f7f\u3044\u3001PHP\u3084JavaScript\u304b\u3089\u30c4\u30a4\u30fc\u30c8\u3059\u308b\u6a5f\u80fd\u3092\u958b\u767a\u3057\u307e\u3059\u3002\u306a\u306e\u3067\u3001\u30c4\u30a4\u30c3\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u4f7f\u3046\u3053\u3068\u3082\u3057\u307e\u305b\u3093\u3002\u30c4\u30a4\u30fc\u30c8\u3059\u308b\u305f\u3081\u3067\u3059\uff09<\/p>\n<p><strong>\uff08Will your app use Tweet, Retweet, like, follow, or Direct Message functionality?\uff09<\/strong><\/p>\n<p>For example, if information about a specific product is registered in my web app, the content will be tweeted automatically.<\/p>\n<p>\uff08\u548c\u8a33\uff1a \u4f8b\u3048\u3070\u3001\u3042\u308b\u7279\u5b9a\u306e\u5546\u54c1\u304c\u767b\u9332\u3055\u308c\u305f\u5834\u5408\u306b\u81ea\u52d5\u7684\u306b\u30c4\u30a4\u30fc\u30c8\u3092\u3057\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5239\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_4-scaled.png\" alt=\"\" width=\"556\" height=\"1000\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_4-scaled.png 556w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_4-167x300.png 167w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_4-569x1024.png 569w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p><strong>\u300cNext\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u78ba\u8a8d\u30da\u30fc\u30b8\u3078\u79fb\u52d5\u3057\u307e\u3059\u306e\u3067<strong>\u300c\u540c\u610f\u3057\u307e\u3057\u305f\u300d<\/strong>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066<strong>\u300cLooks good!\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5237\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_6.png\" alt=\"\" width=\"775\" height=\"127\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_6.png 775w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_6-300x49.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_6-768x126.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5238\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_5.png\" alt=\"\" width=\"221\" height=\"56\" \/><\/p>\n<p>\u3053\u308c\u3067\u7533\u8acb\u81ea\u4f53\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5236\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_7.png\" alt=\"\" width=\"460\" height=\"300\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_7.png 460w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_7-300x196.png 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/p>\n<p>\u5f8c\u306f\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u672c\u4eba\u78ba\u8a8d\u306e\u30e1\u30fc\u30eb\u304c\u5c4a\u3044\u3066\u3044\u307e\u3059\u306e\u3067\u3001<strong>\u300cConfirm your email\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5235\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_8.png\" alt=\"\" width=\"640\" height=\"422\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_8.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_8-300x198.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5234\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_9.png\" alt=\"\" width=\"611\" height=\"191\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_9.png 611w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_9-300x94.png 300w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><\/p>\n<p>\uff08\u8d85\u610f\u8a33\uff1a \u5b8c\u4e86\u301c\uff01\u3082\u3046API\u3068\u304b\u3044\u308d\u3044\u308d\u4f7f\u3048\u308b\u3088\ud83d\ude0a\u2728\uff09<\/p>\n<h2>\u30a2\u30d7\u30ea\u3092\u767b\u9332<\/h2>\n<p>\u767b\u9332\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u540c\u3058\u30da\u30fc\u30b8\u306e\u4e2d\u7a0b\u306b<strong>\u300cCreate an app\u300d<\/strong>\u3068\u3044\u3046\u9805\u76ee\u304c\u3042\u308b\u306e\u3067\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5233\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_10.png\" alt=\"\" width=\"640\" height=\"145\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_10.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_10-300x68.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u30da\u30fc\u30b8\u53f3\u4e0a\u306e<strong>\u300cCreate an app\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5232\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_11.png\" alt=\"\" width=\"152\" height=\"57\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_11.png 152w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_11-150x57.png 150w\" sizes=\"auto, (max-width: 152px) 100vw, 152px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u4f5c\u6210\u3059\u308b\u30a2\u30d7\u30ea\u306e\u5185\u5bb9\u3092\u805e\u304b\u308c\u307e\u3059\u306e\u3067\u3001\u7c21\u5358\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u7c21\u5358\u306b\u56de\u7b54\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u30fbApp name<\/strong><\/p>\n<p>Laravel 5.8 Test\uff08\u30a2\u30d7\u30ea\u540d\uff09<\/p>\n<p><strong>\u30fbApplication description<\/strong><\/p>\n<p>A tweet test from Laravel 5.8.<\/p>\n<p>\uff08Laravel 5.8\u304b\u3089\u306e\u30c4\u30a4\u30fc\u30c8\u30fb\u30c6\u30b9\u30c8\uff09<\/p>\n<p><strong>\u30fbTell us how this app will be used (required)<\/strong><\/p>\n<p>If information about a specific product is registered in Laravel, the content will be tweeted automatically.<\/p>\n<p>\uff08\u7279\u5b9a\u306e\u5546\u54c1\u304c\u767b\u9332\u3055\u308c\u305f\u3089\u3001\u81ea\u52d5\u7684\u306b\u30c4\u30a4\u30fc\u30c8\u3057\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5231\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_12-scaled.png\" alt=\"\" width=\"392\" height=\"1000\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_12-scaled.png 392w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_12-118x300.png 118w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_12-401x1024.png 401w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_12-602x1536.png 602w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/p>\n<p>\u5165\u529b\u304c\u6e08\u3093\u3060\u3089\u3001<strong>\u300cCreate\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u5236\u9650\u4e8b\u9805\u306b\u95a2\u3059\u308b\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u554f\u984c\u306a\u3051\u308c\u3070<strong>\u300cCreate\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5230\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_13.png\" alt=\"\" width=\"600\" height=\"445\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_13.png 600w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_13-300x223.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u30a2\u30d7\u30ea\u767b\u9332\u304c\u5b8c\u4e86\u3057\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308b\u306e\u3067\u3001<strong>\u300cKeys and tokens\u300d<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5229\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_14.png\" alt=\"\" width=\"556\" height=\"360\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_14.png 556w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_14-300x194.png 300w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p>\u521d\u3081\u3066\u8868\u793a\u3059\u308b\u5834\u5408\u306f\u3001API\u30ad\u30fc\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u304c\u30c8\u30fc\u30af\u30f3\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u72b6\u614b\u306a\u306e\u3067\u3001\u307e\u305a\u306f<strong>\u300cAccess token &amp; acdess token secret\u300d<\/strong>\u306e\u4e0b\u306b\u3042\u308b<strong>\u300cCreate\u300d<\/strong>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5228\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_15.png\" alt=\"\" width=\"545\" height=\"355\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_15.png 545w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_15-300x195.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c8\u30fc\u30af\u30f3\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5227\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_16.png\" alt=\"\" width=\"542\" height=\"185\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_16.png 542w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/twitter_notification_16-300x102.png 300w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u304b\u3089<code>Twitter<\/code>\u306b\u81ea\u52d5\u3067\u6295\u7a3f\u3059\u308b\u65b9\u6cd5\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u5546\u54c1\u304c\u767b\u9332\u3055\u308c\u305f\u3089\u6295\u7a3f\u3068\u3044\u3046\u5f62\u3067\u3057\u305f\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u3082\u8003\u3048\u3089\u308c\u307e\u3059\u306e\u3067\u3001\u53ef\u80fd\u6027\u306f\u7121\u9650\u5927\u3068\u8a00\u3063\u3066\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<ul>\n<li>\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u5546\u54c1\u304c\u5024\u4e0b\u3052\u3055\u308c\u305f<\/li>\n<li>\u6bce\u9031\u6c34\u66dc\u65e5\u306e5%\u5f15\u304d\u30bb\u30fc\u30eb\u3092\u6295\u7a3f<\/li>\n<li>\u767b\u9332\u8005\u6570\u304c\u30be\u30ed\u76ee\u306b\u306a\u3063\u305f\u3089\u307f\u3093\u306a\u306b\u5831\u544a<\/li>\n<li>\u5546\u54c1\u304c\u524a\u9664\u3055\u308c\u305f\u3089\u300c\u58f2\u308a\u5207\u308c\u300d\u3068\u3057\u3066\u5831\u544a<\/li>\n<\/ul>\n<p>\u306a\u3069\u306a\u3069\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u30b5\u30a4\u30c8\u3082<code>Twitter<\/code>\u3068\u9023\u643a\u3092\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-25 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15.png\" alt=\"\" width=\"348\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15.png 348w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15-300x276.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15-30x28.png 30w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u30fb\u524d\u3005\u56de\u3068\u753b\u50cf\u306b\u95a2\u9023\u3059\u308b\u6a5f\u80fd\u3092Laravel\u3067\u958b\u767a\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u305d\u3057\u3066\u3001\u753b\u50cf\u95a2\u9023\u3067\u4ed6\u306b\u3082\u4f55\u304b\u304a\u5c4a\u3051\u3067\u304d\u308b\u5185\u5bb9\u304c\u306a\u3044\u304b\u3068\u8003\u3048\u3066\u3044\u305f\u3068\u3053\u308d\u3001\u753b\u50cf\u304c\u30e1 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=5226\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel\u3067Twitter\u6295\u7a3f\uff08\u753b\u50cf\u3064\u304d\uff09\u3010\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\u3011&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":5259,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,97],"tags":[134,192,83],"class_list":["post-5226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-97","tag-api","tag-twitter","tag-83"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5226","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=5226"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5226\/revisions"}],"predecessor-version":[{"id":8495,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5226\/revisions\/8495"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/5259"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}