Giter Site home page Giter Site logo

lccnet-laravel's Introduction

MVC

Model 模型 View 視圖 Controller 控制器

從github下載的執行方法

  1. 將下載好的資料夾放到xampp/htdocs內
  2. 透過localhost建立資料庫
  3. 執行 composer install 安裝所需套件
  4. 執行 copy .env.example .env 產生.env
  5. 設定.env內的資料庫資訊
  6. 執行 php artisan key:generate 產生金鑰
  7. 執行 php artisan serve 開啟測試伺服器

put 與 patch

  • put(替換資源)

用put方法送出更新,不只使用者的姓名會更新,連帶的連其實沒有要更新的大頭照以及描述都會在更新一次。

  • patch(更換資源部分內容)

用patch方法送出更新,則僅會將使用者姓名更新 ,沒有動到的大頭照以及描述並不會也一起更新一次。

Artisan 指令

#執行開發者伺服器
php artisan serve

#建立資料表遷移 migration
php artisan make:migration create_posts_table

php artisan make:migration add_user_id_to_posts --table=posts

#執行migration (推到資料庫)
php artisan migrate

#回復上一次migrate
php artisan migrate:rollback

#重製migration
php artisan migrate:reset

#查看migration狀態
php artisan migrate:status

#建立Controller
php artisan make:controller PostController

#使用resource建立Controller 
php artisan make:controller PostController --resource

#查詢路由
php artisan route:list

#建立Model
php artisan make:model Post

#參數
# c: controller
# m: migration
# r: resource


#建立storage連結
php artisan storage:link

lccnet-laravel's People

Contributors

a19860101 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.