GithubHelp home page GithubHelp logo

atsuyokota / laravel-ddd-api Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 952 KB

RESTful API and DDD sample with Laravel

Dockerfile 0.82% PHP 95.83% JavaScript 0.54% CSS 0.01% HTML 2.82%
api-rest ddd laravel layered-architecture php

laravel-ddd-api's People

Contributors

atsuyokota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kasunvimarshana

laravel-ddd-api's Issues

Laravelのインストール

手順

# docker起動
$ docker-compose up -d

# httpdコンテナにログイン
$ docker-compose exec httpd-laravel bash

# Laravelプロジェクトを作成
$ laravel new

事前準備

  • LaravelはDocker内でインストール済みのこと
composer global require laravel/installer

ArticleUseCaseを追加

概要

  • Domain層にUseCaseを追加
  • ArticleUseCaseを追加し、Controllerから呼び出すように変更する

Seedingで初期データを登録

Seed

  • Migrationの実行
php artisan migrate
  • Seedファイルの生成
php artisan make:seeder UsersTableSeeder
  • Seederを実行
php artisan db:seed --class=UsersTableSeeder

ApacheとPHPの設定

概要

  • httpd.confとphp.iniを作成し、所定の場所にコピーする

作業内容

  • ドキュメントルートの変更
  • phpモジュールの有効化
  • .htaccessの許可
  • DirectoryIndexの設定変更

Webコンテナ構築

作業項目

  • Dockerファイルの作成
  • イメージの作成
  • コンテナの作成

テスト

  • Dockerイメージが作成されるか
  • コンテナが正常に起動するか
  • HTTPアクセスできるか

Image作成コマンド

docker build -t httpd-laravel:latest ./ -f ./docker/Dockerfile

コンテナの起動

docker create --name httpd-laravel -e name="httpd-laravel" -p 8888:80 httpd-laravel:latest

アクセス

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.