Code Monkey home page Code Monkey logo

larazhihu's Introduction

命令记录

# 创建控制器
php artisan make:controller QuestionsController

# 直接执行测试文件
phpunit tests/Feature/ViewQuestionsTest.php 

# --filter 后面是测试的方法名
phpunit --filter user_can_view_questions

# 建立 Question 模型,并同时生成数据库迁移文件:
php artisan make:model Question -m

# 建立模型工厂
php artisan make:factory QuestionFactory -m Question

# 创建权限策略
php artisan make:policy QuestionPolicy --model=Question

# 查看当前使用的镜像源
yarn config get registry
# 使用阿里云源
yarn config set registry https://registry.npm.taobao.org/

# 运行 mix 编译命令:
npm run watch-poll

# 运行数据库迁移命令
php artisan migrate

使用 tikner 构造数据

php artisan tinker


## 创建数据
>>> $question = create(\App\Question::class, ['published_at' => \Carbon\Carbon::now()]);
>>> create(\App\Answer::class, ['question_id' => $question->id], 10);

larazhihu's People

Contributors

yonh 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.