---
# System prepended metadata

title: '[laravel][artisan]artisan筆記'
tags: [artisan, laravel]

---

# [laravel][artisan]artisan筆記
###### tags: `laravel`,`artisan`


## 查看所有artisan指令
```c!
php artisan list
```

## 查看所有artisan make指令
```c!
php artisan list make
```
>php artisan list後面加上其它的字串,可查看跟該字串相關的所有指令


## 運行專案
```c!
$ php artisan serve
```

## 顯示專案的版本
https://tecadmin.net/check-laravel-version/
```c!
$ php artisan --version
```

## 查看所有routes
```c!
$ php artisan route:list
```

## 運行migrate
```c!
$ php artisan migrate
```

## 查看migration狀態
```c!
$ php artisan migrate:status
```

## 開啟命令列模式:使用tinker
```c!
$ php artisan tinker
```

## 建立controller
```c!
$ php artisan make:controller ControllerName
```

## 建立resource controller
```c!
$ php artisan make:controller ControllerName --resource
```

## 建立model
```c!
$ php artisan make:model ModelName
```

## 建立model & migration檔
```c!
$ php artisan make:model ModelName -m
```

## 建立migration

```c!
$php artisan make:migration MigrationName
```

## 清除cache
```c!
$ php artisan cache:clear
$ php artisan view:clear
$ php artisan config:cache
```