laravel5.4 Create model, controller, validate model

Source: Internet
Author: User
laravel5.4 Creating a Model: PHP artisan Make:model Test
laravel5.4 Create controller: PHP artisan make:controller Photocontroller
laravel5.4 Creating a Resource controller: PHP artisan make:controller photocontroller--resource
laravel5.4 Creating a Resource Controller Companion model: PHP artisan make:controller photocontroller--resource--model=photo
Route cache PHP Artisan Route:cache
Route cleanup Cache php Artisan Route:clear

Create form Validation class PHP artisan make:request storeblogpost (verify name)

Usage: The validation method can be written in the generated class

/**
 * Store Input blog post
 *
 * @param  storeblogpostrequest  $request
 * @return Response
*/ Public function Store (Storeblogpost $request) {
    //The incoming request is valid ...
}

The original from the Shu 168 http://www.xiaoshu168.com/php/45.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.