Giter Club home page Giter Club logo

todoapp_by_phplaravel's Introduction

Todoアプリ by PHP Laravel

概要

  • CRUDの練習としてTodoアプリ作成した
  • 簡易的なもののためSQLiteを使った
  • MVCアーキテクチャ

方針

テーブル

  • id
    • ID
  • task_name
    • タスクの名前
  • task_description
    • タスクの説明
  • assign_person_name
    • 担当者の名前(認証機能実装しないから)
  • estimate_hour
    • 見積時間

ルーティング

  • GET /:TodolistFormController@index
    • トップページを返す
  • GET /create-page:TodolistFormController@createPage
    • タスクの作成ページを返す
  • POST /create:TodolistFormController@create
    • タスクの作成実行
  • GET /edit-page:TodolistFormController@editPage
    • タスクの編集ページ
  • POST /edit:TodolistFormController@edit
    • タスクの編集を実行
  • GET /delete-page:TodolistFormController@deletePage
    • タスクの削除ページを返す
  • POST /delete:TodolistFormController@delete
    • タスクの削除を実行

作業進捗

  • composer create-project laravel_todolistでプロジェクト作成

テーブル作成

  • SQLite3使う
    • database/database.sqlite作成
  • .envファイル編集してDB_CONNECTION=sqliteとした
  • マイグレーション実行
    • sqlite3 database/database.sqliteで接続確認可能
    • .tableで確認可能
  • マイグレーションファイル作成
    • php artisan make:migration create_todos_table --create=todos
  • todosテーブル作成
    • マイグレーションファイルのcreateにカラム追加

モデルクラスを実装

  • php artisan make:model Todoで作成
    • app/Todo.phpが生成される

コントローラの作成

  • php artisan make:controller TodolistFormCOntrollerで作成
    • app/Http/Controllers/TodolistFormController.phpが作成される

ビューの作成

  • resources/viewstodo_list.blade.phpを作成
    • artisanコマンドで作成できないらしい

ルーティングの設定

  • routes/web.phpを編集する

CRUD実装

  • 方針にある通りにルーティングをおこない、コントローラに関数を作りビュー作る

todoapp_by_phplaravel's People

Contributors

msdsm avatar

Watchers

 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.