same vein, we will install a very powerful plugin for development, Way/generators, which is its name in the composer library. Added in Composer.json:
Copy the Code code as follows:"Require-dev": {"Way/generators": "~2.0"},
Put it under "require".
Run composer Update, and then add the configuration in./app/config/app.php:
Copy the Code code as follows:' Way\generators\generatorsserviceprovider '
Once the installation is complete, run PHP artisan on th
line. Try it.
laravel -V
If you can see the following, it means the operation is successful.
Laravel Installer version 1.2.1
2. Create a project.
laravel new guagua
3. Configure redis and queue.
4. Create a controller,
php artisan make:controller DefaultController
Push100 queue tasks in the controller action.
for($i = 0; $i
5. Create the queue Command
php artisan make:command SendEmail --queued
.
Laravel New Guagua
3, configure Redis and queue.
4, create Controller,
PHP Artisan Make:controller Defaultcontroller
The task of push100 a queue in the controller action.
for ($i = 0; $i
5, create the command of the queue
PHP Artisan Make:command SendEmail--queued
Modify app/commands/sendemail.php to add a private variable.
protected $msg;
In the past when we were doing database data testing, it is generally manual to add data, such as in the database query using SQL statements for data insertion. If the data is low, it's pretty easy, but if the data is too big, it's going to hurt, even if you copy the SQL statement. But all this, in Laravel, has become very easy.
Examples of this article are tested for the latest version 5.3 of Laravel, please leave a comment in the comments section if there is a problem with the other version. C
.*","Cartalyst/sentry": "2.1.4"},
Then, run the command in the project root directory.
The Code is as follows:
Composer update
Wait a moment and it will prompt that the installation of cartalyst/sentry 2.1.4 is complete.
Similarly, we will install a very powerful plug-in for development, way/generators, which is its name in the composer library. Add the following content to composer. json:
The Code is as follows:
"Require-dev ":{"Way/generators ":"~ 2.0"},
Put it under "require.
Run comp
Phpartisan common method 1. generate a controller
php artisan make:controller PhotoController
2. generate a controller using RESTFUL
php artisan make:controller PhotoController --resource
Route::resource('photo', 'PhotoController');
Why do we use the resource parameter? because we design the add, delete, modify, and query operations in the background, and these operations can be directly generated usi
a moment and it will prompt cartalyst/sentry 2.1.4 installation is complete.
In the same vein, we will install a very powerful plugin for development, Way/generators, which is its name in the composer library. Added in Composer.json:
Copy the Code code as follows:"Require-dev": {"Way/generators": "~2.0"},
Put it under "require".
Run composer Update, and then add the configuration in./app/config/app.php:
Copy the Code code as follows:' Way\generators\generatorsserviceprovider '
Once the installa
.*","Cartalyst/sentry": "2.1.4"},
Then, run the command in the project root directory.
The code is as follows:
Composer update
Wait a moment and it will prompt that the installation of cartalyst/sentry 2.1.4 is complete.
Similarly, we will install a very powerful plug-in for development, way/generators, which is its name in the composer Library. Add the following content to composer. json:
The code is as follows:
"Require-dev ":{"Way/generators ":"~ 2.0"},
Put it under "require.
Run compos
Let's talk about the optimization skills of the Laravel 5 Framework of the PHP program.
Laravel is a powerful framework with many components and huge Code. Its ease of use sacrifices performance. Even so, Laravel is still an excellent framework, however, in the formal environment, we must optimize and speed up website opening.
Next, we will share some development best practices and optimization skills. You are welcome to leave a message to discuss other suggestions.
Here is a simple list:
Config
Laravel 5 framework performance optimization skills, laravel Performance Optimization
Performance has always been a criticism of the Laravel framework, so tuning Laravel programs is a required skill.
Next, I will share some development best practices and optimization skills. If you have other suggestions, please leave a message to discuss them.
1. Configure Cache Information
Use the artisan Command provided by laravel to cache all configurations in th
1. Introduction
Migrations, like versioning of databases, allow teams to easily edit and share the database table structure of the application, migrating common and laravel structure builder pairs to make it easy to build the database table structure of the application.
Laravel's schema façade provides support for creating and manipulating tables unrelated to the database system, providing consistent, elegant, and smooth APIs in all database systems supported by Laravel.
2. Generate Migration
ExtensionStarting with the PHP 5.5 version, installation packages for some operating systems require you to manually install the PHP JSON extension module. If you are using Ubuntu, you can install it directly via the Apt-get install Php5-json command.
Iv. Display
Necessary plug-in installation and configurationWe use the famous Sentry plug-in to build a login authorization system.
Open./composer.json, change to:
"Require": {"Laravel/framework": "4.2.*","Cartalyst/sentry": "2.1.4"},
Then,
Database migrations is one of the most powerful features of Laravel. Database migration can be understood as the version controller of the database.
The Database/migrations directory contains two migration files, one to create a user table and one for user password resets.
In the migration file, the up method is used to create the data table, and the down method is used for rollback, that is, to delete the data table.
Performing a Database migration
Copy Code code as follows:
Introduction
Laravel 5.3 of Auth certification on the basis of 5.2 and some changes, this article explains how to do different user tables in Laravel 5.3 login authentication. Brief introduction of Auth Authentication principle
Laravel certification is the use of guard and provider with the completion of the guard responsible for the authentication of the business logic, authentication information service-side preservation, etc. provider is responsible for providing certification information to
frontend displays the created forms and comments;
You can create a new comment and add it to our W/O page to refresh the list;
You can delete a comment and remove it from the W/O page refresh list.
In general, these are very simple concepts. We focus on the intricate relationships between Laravel and Angular.
Laravel backendSet Laravel
Continue to set up your Laravel. We will do some basic work to add, delete, modify, and query comments on Our backend:
Create a database for Migration
When you run phpartisanserve, an error occurs suddenly. {code ...}
An error occurs when you run php artisan serve.
Warning: Invalid argument supplied for foreach() in D:\xampp\htdocs\baiduyun\vendor\composer\autoload_real.php on line 27Call Stack: 0.0012 120376 1. {main}() D:\xampp\htdocs\baiduyun\artisan:0 0.0016 122520 2. require('D:\xampp\htdocs\baiduyun\bootstrap\autoload.php') D:\x
Laravel4 basic tutorial: Views, namespaces, and routes. Laravel4 basic tutorial: View, namespace, and routing; laravel basic tutorial 1. view Separation and nesting run the command phpartisangenerate: viewadmin in the learnlaravel folder. laravel 4 basic tutorial: View, namespace, and routing
1. View Separation and nesting
Run the following command in the learnlaravel folder:
php artisan generate:view admin._layouts.default
At this time, the generato
. Create Controller,
PHP Artisan Make:controller Defaultcontroller
Push100 a queue task in the Controller's action.
for ($i = 0; $i
5. Create Queue command
PHP Artisan Make:command SendEmail--queued
Modify app/commands/sendemail.php to add a private variable.
protected $msg;
Modify the constructor at the same time.
Public function __construct ($msg) { $this->msg = $msg;}
Handle method of re-modification
P
frontend displays the created forms and comments;
You can create a new comment and add it to our W/O page to refresh the list;
You can delete a comment and remove it from the W/O page refresh list.
In general, these are very simple concepts. We focus on the intricate relationships between Laravel and Angular.
Laravel backendSet Laravel
Continue to set up your Laravel. we will do some basic work to add, delete, modify, and query comments on our backend:
Create a database for migration
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.