一、常用的命令:
php artisan list? ? ? ? ? ? ? ? ? ? ? ? ? ? ?查看php artisan所有命令
php artisan --help? ? ? ? ? ? ? ? ? ? ? ? 查看php artisan的用法
php artisan help admin:make? ? ? 查看php artisan admin:make的用法
php artisan admin:make --help? ?查看php artisan admin:make的用法
創建控制器
1. `php artisan make:controller OrderController`
創建[Rest風格](https://so.csdn.net/so/search?q=Rest%E9%A3%8E%E6%A0%BC&spm=1001.2101.3001.7020)資源控制器(帶有index、create、store、edit、update、destroy、show方法)
1. `php artisan make:controller?OrderController?--resource`
創建模型
1. `php artisan make:model?Student`
創建新建表的遷移和修改表的遷移
1. `php artisan make:migration create_orders_table?--create=orders?//創建訂單表orders`
2. `php artisan make:migration add_tags_to_orders_table?--table=orders//給orders表增加tags字段`
執行遷移
1. `php artisan migrate`
創建模型的時候同時生成新建表的遷移+控制器+路由
1. `php artisan make:model?Order?-m -c -r`
回滾上一次的遷移
1. `php artisan migrate:rollback`
回滾所有遷移
1. `php artisan migrate:reset`
創建填充
1. `php artisan make:seeder?OrderTableSeeder`
執行單個填充
1. `php artisan db:seed?--class=OrderTableSeeder`
執行所有填充
1. `php artisan db:seed`
創建中間件(app/Http/Middleware?下)
1. `php artisan make:middleware?Activity`
創建隊列(數據庫)的表遷移(需要執行遷移才生效)
1. `php artisan queue:table`
創建隊列類(app/jobs下):
1. `php artisan make:job?SendEmail`
創建請求類(app/Http/Requests下)
1. `php artisan make:request?CreateArticleRequest`
二、通常一個[laravel](https://so.csdn.net/so/search?q=laravel&spm=1001.2101.3001.7020)項目的后臺管理系統搭建流程,如下
1、下載Laravel框架,安裝Laravel-admin后臺管理框架,進行基礎的數據庫連接配置,上傳配置,https/http訪問方式等
2、[Linux服務器](https://so.csdn.net/so/search?q=Linux%E6%9C%8D%E5%8A%A1%E5%99%A8&spm=1001.2101.3001.7020)下面,進入項目的根目錄,可以用php artisan make命令創建模型+數據遷移+控制器。
3、用php artisan admin:make 創建后臺的控制器,可以寫腳本批量創建。之后根據業務邏輯,編寫控制器內容。
4、為后臺的控制器創建對于的路由,可以寫腳本批量創建。
5、登錄Laravel-admin后臺系統,設置對應的菜單。
### 三、Laravel Artisan 命令大全
### Available commands:
| 命令 | 中文 | English |
| --- | --- | --- |
| clear-compiled | 刪除已編譯的類文件 | Remove the compiled class file |
| down | 將應用程序置于維護模式 | Put the application into maintenance mode |
| dump-server | 啟動轉儲服務器以收集轉儲信息。 | Start the dump server to collect dump information. |
| env | 顯示當前的框架環境 | Display the current framework environment |
| help | 顯示命令的幫助 | Displays help for a command |
| inspire | \--- | Display an inspiring quote |
| list | 列出命令 | Lists commands |
| migrate | 運行數據庫遷移 | Run the database migrations |
| optimize | 緩存框架引導程序文件 | Cache the framework bootstrap files |
| preset | 為應用程序交換前端腳手架 | Swap the front-end scaffolding for the application |
| serve | 在 PHP 開發服務器上提供應用程序 | Serve the application on the PHP development server |
| tinker | 與您的應用程序互動 | Interact with your application |
| up | 使應用程序退出維護模式 | Bring the application out of maintenance mode |
### app
| 命令 | 中文 | English |
| --- | --- | --- |
| app:name | 設置應用程序命名空間 | Set the application namespace |
### auth
| 命令 | 中文 | English |
| --- | --- | --- |
| auth:clear-resets | 刷新過期的密碼重置令牌 | Flush expired password reset tokens |
### cache
| 命令 | 中文 | English |
| --- | --- | --- |
| cache:clear | 刷新應用程序緩存 | Flush the application cache |
| cache:forget | 從緩存中刪除項目 | Remove an item from the cache |
| cache:table | 為緩存數據庫表創建遷移 | Create a migration for the cache database table |
### config
| 命令 | 中文 | English |
| --- | --- | --- |
| config:cache | 創建緩存文件以加快配置速度 | Create a cache file for faster configuration loading |
| config:clear | 刪除配置緩存文件 | Remove the configuration cache file |
### db
| 命令 | 中文 | English |
| --- | --- | --- |
| db:seed | 填充數據庫 | Seed the database with records |
### event
| 命令 | 中文 | English |
| --- | --- | --- |
| event:generate | 根據注冊生成缺少的事件和偵聽器 | Generate the missing events and listeners based on registration |
### key
| 命令 | 中文 | English |
| --- | --- | --- |
| key:generate | 生成應用程序 key | Set the application key |
### lang
| 命令 | 中文 | English |
| --- | --- | --- |
| lang:publish | 將語言文件發布到資源目錄 | publish language files to resources directory. |
### make
| 命令 | 中文 | English |
| --- | --- | --- |
| make:auth | \--- | Scaffold basic login and registration views and routes |
| make:channel | 創建一個新的?`channel`?類 | Create a new channel class |
| make:command | 創建一個新的?`Artisan`?命令 | Create a new Artisan command |
| make:controller | 創建一個新的控制器類 | Create a new controller class |
| make:event | \--- | 創建一個新的?`event`?類 |
| make:exception | 創建一個新的自定義異常類 | Create a new custom exception class |
| make:factory | 創建一個新的模型工廠 | Create a new model factory |
| make:job | 創建一個新的工作類 | Create a new job class |
| make:listener | 創建一個新的事件監聽器類 | Create a new event listener class |
| make:mail | 創建一個新的電子郵件類 | Create a new email class |
| make:middleware | 創建一個新的中間件類 | Create a new middleware class |
| make:migration | 創建一個新的遷移文件 | Create a new migration file |
| make:model | 創建一個新的 Eloquent 模型類 | Create a new Eloquent model class |
| make:notification | 創建一個新的通知類 | Create a new notification class |
| make:observer | 創建一個新的觀察者類 | Create a new observer class |
| make:policy | 創建一個新的策略類 | Create a new policy class |
| make:provider | 創建一個新的服務提供者類 | Create a new service provider class |
| make:request | 創建一個新的表單請求類 | Create a new form request class |
| make:resource | 創建一個新資源 | Create a new resource |
| make:rule | 創建新的驗證規則 | Create a new validation rule |
| make:scaffold | 代碼生成器 —?Laravel 5.x Scaffold Generator | Create a laralib scaffold |
| make:seeder | 創建一個新的?`seeder`?類 | Create a new seeder class |
| make:test | 創建一個新的測試類 | Create a new test class |
### migrate
| 命令 | 中文 | English |
| --- | --- | --- |
| migrate:fresh | 刪除所有表并重新運行所有遷移 | Drop all tables and re-run all migrations |
| migrate:install | 創建遷移存儲庫 | Create the migration repository |
| migrate:refresh | 重置并重新運行所有遷移 | Reset and re-run all migrations |
| migrate:reset | 回滾所有數據庫遷移 | Rollback all database migrations |
| migrate:rollback | 回滾上次數據庫遷移 | Rollback the last database migration |
| migrate:status | 顯示每次遷移的狀態 | Show the status of each migration |
### notifications
| 命令 | 中文 | English |
| --- | --- | --- |
| notifications:table | 為通知表創建遷移 | Create a migration for the notifications table |
### optimize
| 命令 | 中文 | English |
| --- | --- | --- |
| optimize:clear | 刪除緩存的引導程序文件 | Remove the cached bootstrap files |
### package
| 命令 | 中文 | English |
| --- | --- | --- |
| package:discover | 重建緩存的包清單 | Rebuild the cached package manifest |
### queue
| 命令 | 中文 | English |
| --- | --- | --- |
| queue:failed | 列出所有?`failed`?隊列工作 | List all of the failed queue jobs |
| queue:failed-table | 為?`failed`?隊列工作數據庫表創建遷移 | Create a migration for the failed queue jobs database table |
| queue:flush | 刷新所有?`failed`?隊列工作 | Flush all of the failed queue jobs |
| queue:forget | 刪除?`failed`?隊列工作 | Delete a failed queue job |
| queue:listen | 監聽一個給定的隊列 | Listen to a given queue |
| queue:restart | 在當前工作之后重新啟動隊列工作器守護程序 | Restart queue worker daemons after their current job |
| queue:retry | 重試?`failed`?隊列作業 | Retry a failed queue job |
| queue:table | 為隊列工作數據庫表創建遷移 | Create a migration for the queue jobs database table |
| queue:work | 開始將隊列上的工作作為守護程序處理 | Start processing jobs on the queue as a daemon |
### route
| 命令 | 中文 | English |
| --- | --- | --- |
| route:cache | 創建路由緩存文件以加快路由注冊速度 | Create a route cache file for faster route registration |
| route:clear | 刪除路由緩存文件 | Remove the route cache file |
| route:list | 列出所有注冊的路由 | List all registered routes |
### schedule
| 命令 | 中文 | English |
| --- | --- | --- |
| schedule:run | 運行預定的命令 | Run the scheduled commands |
### session
| 命令 | 中文 | English |
| --- | --- | --- |
| session:table | 為會話數據庫表創建遷移 | Create a migration for the session database table |
### storage
| 命令 | 中文 | English |
| --- | --- | --- |
| storage:link | 創建從 “公共 / 存儲” 到 “存儲 / 應用 / 公共” 的符號鏈接 | Create a symbolic link from "public/storage" to "storage/app/public" |
### vendor
| 命令 | 中文 | English |
| --- | --- | --- |
| vendor:publish | 從供應商包中發布任何可發布的資產 | Publish any publishable assets from vendor packages |
### view
| 命令 | 中文 | English |
| --- | --- | --- |
| view:cache | 編譯所有應用程序的 Blade 模板 | Compile all of the application's Blade templates |
| view:clear | 清除所有編譯的視圖文件 | Clear all compiled view files
? |
- 后端
- composer
- composer配置國內鏡像
- composer安裝及設置2
- PHP
- 貝塔SG11加密
- 申請KEY
- 開始加密
- php 中連接tcp服務的三種方式
- php websocket 教程
- editor內容轉換數組
- 使用正則判斷中文維吾爾文
- PHP常用函數總結
- 常用助手函數
- 通過Imagick把pdf轉換圖片
- 維吾爾語基本區轉換擴展區
- php GD庫生成一個由文字和圖片生成新的圖片
- aes加密
- php數組函數 -- array_column,array_multisort 實現二維數組排序
- PHP操作Excel
- php更新內容
- 輔助查詢(*)
- 【時間】操作
- 時間函數例子
- Date/Time 函數(不包含別名函數)
- php網絡相關
- HTTP請求的返回值含義說明
- 使用php語言開發一個類似數據庫操作的文件表類
- pinyin
- 維吾爾語基本區轉換擴展區(2)
- php獲取當前環境的信息
- laravel
- laravel 隊列的使用
- laravel 自定義助手函數
- laravel seeder的使用
- laravel項目從git下載命令
- laravel 多個數據庫配置
- laravel 填充假數據
- laravel 動態路由
- laravel 自定義 validate 響應
- laravel 創建追加字段的模擬訪問器
- laravel 線上環境的數據庫更改或添加字段
- laravel 模型查詢按照whereIn排序
- laravel 使用 workerman 通過TCP 文件傳輸功能
- laravel api Header添加Accept頭
- Laraval IDE 自動補全插件 laravel-ide-helper
- laravel 網站后臺
- laravel 設置路由
- laravel-第三方composer包
- laravel 開發技巧
- laravel 昨天,今天時間
- 使用寶塔計劃任務啟動laravel調度器
- laravel結合workerman第二節
- Laravel - 上傳多個文件
- 查詢聊天好友列表
- 事件系統 event, listener
- laravel 安裝 laravel-modules
- 自定義求看守器-toekn
- laravel限流
- 使用 Laravel api Resource 類時自定義分頁信息
- Laravel php artisan命令大全
- 驗證器
- workerman 創建wss服務
- 架構師必須知道的26項PHP安全實踐
- python
- Python讀取文件代碼塊已經備好,用的時候光拿(建議收藏)
- Python常用庫大全
- api 簽名驗證
- git
- git命令
- 十分鐘學會git基礎
- Git代碼同時上傳到GitHub和Gitee(碼云)
- Git - 多人協同開發利器,團隊協作流程規范與注意事項
- 刪除遠程倉庫的文件
- github查詢方法
- 錯誤
- 解除項目git版本控制
- linux
- sentos安裝supervisor
- PHP怎么守護進程運行php腳本
- 600條最強Linux命令總結
- centos開啟防火墻、開放指定端口
- 前端
- vue
- vue2發布之前的config簡單配置
- vue2安裝scss命令
- vue2父子組件之間雙向數據綁定
- 國際化雙語--安裝VueI18n
- vue3-setup 組件傳參(defineProps、defineEmits、defineExpose
- Vue3 新寫法速覽:十分鐘內輕松get
- 關于vue的外連接
- watch講解
- computed
- webpack 打包后生成很多小文件怎么優化?
- vue2 vue.config.js常見配置和打包部署測試
- 小程序
- 小程序長期訂閱消息
- 小程序自定義TabBar后如何實現keep-alive
- 收藏的html和css和js
- CSS 省略號(單行省略號、多行省略號)
- UyghurInput_a.js
- font.css
- 漂亮按鈕樣式
- clock.html
- css
- scroll css樣式
- CSS流動布局-頁面自適應
- css grid布局
- 禁止wap頁面調整字體大小
- CSS @media 和 min-width/max-width
- 網站變灰是怎么實現的
- 瀑布流實現方式
- javascript
- SortableJS拖動排序
- wondow scroll滾動到上邊
- 原生js插入HTML元素
- Konva.js —— 像操作DOM一樣操作canvas
- 通過canvas合并倆個圖片
- js scroll更多加載
- js 實現復制功能
- js判斷安卓和蘋果或者微信
- 瀏覽器打開控制臺禁止
- 原生js一些dom操作
- js http客戶端集合
- fetch
- axios
- canvas 點鐘
- layer dialog
- jquery 和 laravel ajax全局配置
- layui 獲取select的自定義參數
- konva.js中文開發文檔
- js 大文件分片上傳
- js監聽網絡狀態實現斷網重連后自動刷新頁面
- js生成video縮略圖
- JS獲取當前系統電量情況
- uniapp
- uni-app swiper數量過多時卡頓優化方案
- uniapp 帖子集合
- 微信wap
- wap分享朋友和朋友圈
- wap 手機頁面微信支付
- JsSdk微信公眾號支付
- 通用各種小知識
- 正則表達式
- JS正則匹配過濾字符串中的html標簽及html標簽內的內容
- 判斷維吾爾文輸入
- 正則表達式符號
- 正則表達式練習
- 百度網盤不限速下載助手
- 解決VSCode下載慢或下載失敗的問題
- 性能測試 使用Apache的ab測試工具
- nginx從入門到精通
- nginx
- Nginx 是怎么禁止訪問php的 ?
- 寶塔面板
- supervisor
- 卸載寶塔
- redis
- redis實用筆記
- redis入門到精通
- phpredis
- redis數據庫基礎
- PHP對Redis的基本操作
- ffmpeg
- 合并多個音視
- 獲取音視時長
- FFmpeg視頻處理入門教程(新手必看)
- 外連接
- 安裝
- PHP基于ffmpeg實現轉換視頻,截圖及生成縮略圖的方法
- Linux安裝ffmpeg
- docker
- 服務實現
- docker基本命令
- rewrite筆記
- 別人筆記鏈接
- 計算機常用知識
- 二進制1-10
- 斐波那契數列
- mysql
- 高性能高可用的MySQL,得從各種規范開始
- 讀寫分離配置
- 重要外連接,前端/ 后端/數據庫等等
- 關于程序必須收藏的文章鏈接集合
- markdown
- 一篇文章講清楚markdown