# Laravel_Queue

[20分鐘學會Laravel的Queue功能 (pandalab.org)](https://www.pandalab.org/articles/107)

修改設定檔 env.php -&gt; 指定何種連接

queue.php 連接設定

[![image-1637202514068.png](https://bookstack.treemanou.com/uploads/images/gallery/2021-11/scaled-1680-/mL8DFlh054owdEE9-image-1637202514068.png)](https://bookstack.treemanou.com/uploads/images/gallery/2021-11/mL8DFlh054owdEE9-image-1637202514068.png)

[![image-1637202726195.png](https://bookstack.treemanou.com/uploads/images/gallery/2021-11/scaled-1680-/0ZD3mQBGlPv9OePm-image-1637202726195.png)](https://bookstack.treemanou.com/uploads/images/gallery/2021-11/0ZD3mQBGlPv9OePm-image-1637202726195.png)

建立table

```shell
# 建立 jobs table
php artisan queue:table
# 建立 failed-table
php artisan queue:failed-table

#  執行建立工作
php artisan migrate

```

建立job

```shell
#php artisan make:job {job name}
php artisan make:job TestGcm
```