1. Create a new file
PHP Artisan generate:seed Page
Create a new app/database/seeds/pagetableseeder.php file.
PHP Artisan Generate:model Article
Create a new app/models/article.php file.
PHP Artisan Generate:view Admin._layouts.default
Create a new app/views/admin/_layouts/default.blade.php file.
2. Installing the composer component
Add the component name and version number in Composer.json require or Require-dev:
"Edvinaskrucas/notification": "3.0.1"
Execute the composer Update command at the root of the app
Add a line to App.php's providers:
' Krucas\notification\notificationserviceprovider ',
Add a line to App.php's aliases:
' Notification ' = ' krucas\notification\facades\notification ',
3. Tips for handling methods that the class cannot find
Composer Dump-autoload
4. After creating a new folder, add the path to a row of folders in the Composer.json autoload classmap to find the file.
5.
Sentry::check () Check if the user is logged in
Input::get (' email ') get the data obtained by the user Get method
Execute command PHP artisan serve, run Lavarel development server.
Redirect::route (' Admin.login ')
Redirect::to (' eadmin/products ')
Html::link (' Accounts/newaccount ', ' register ', Array (' class ' = ' default-btn '))
Form::open (Array (' url ' = ' accounts/signin '))
6. Eloqyent
Class Page extends \eloquent {
Use the users database by default
protected $table = ' myusers '; If the value of the Tabel property is specified, a table with table name is used.
The primary key for the default table is the ID
protected $primaryKey = ' IDs '; Change the primary key name by specifying Primarkey
Default Updated_at created_at fields per database
can set
protected $timestamps = false; Cancel the two fields
Protected $appends = Array ("", ""); Fields that need to be used but not in the database,
Protected $hidden = Array ("", ""); You need to hide the fields to restrict the property data that can appear in the array or JSON format
Use softdeletingtrait; The soft delete feature is turned on, and data is not deleted from the database when data is deleted using the model instance, and the value is to add a deleted_at timestamp.
protected function GetDateFormat () {return ' U ';}//Custom timestamp format can override this method
}
The above describes the Laravel study note one, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.