Why would become the most successful Laravel PHP framework?

In 2011, Taylor Otwell Laravel will serve as a framework comprising a new modern methods introduced to everyone. Laravel originally designed to MVC-oriented architecture that can satisfy such as event handling, user authentication and other needs. In addition it has a strong support by a management database for managing modularity and scalability of the code package manager.

Laravel its simple, elegant features to win everyone's attention, whether expert or novice, in the development of PHP projects, will be the first time the thought of Laravel. In this article we will discuss why Laravel will become the most successful PHP framework.

Modularity and scalability

Laravel focus modular and scalable code. You can include more than 5500 packages Packalyst directory to find any file you want to add. Laravel goal is to make you able to find any file you want.

Micro Services and APIs

Lumen is a laravel derived from the micro-focus on streamlined frame. It is a high-performance programming interface that lets you quickly and easily develop a more micro-projects. Lumen use minimal configuration incorporates all the important features of laravel, you can copy the code to the project laravel way to complete framework migrated.

1
2
3
4
5
6
get( '/' , function() {
return  view( 'lumen' );
});
$app>post( 'framework/{id}' , function($framework) {
$ this >dispatch( new  Energy($framework));
});

HTTP path

It laravel have like Ruby on Rails, fast, and efficient routing system. It allows users to enter by way of the path in the browser so that each part of the application is associated.

1
2
3
Route::get( '/' , function () {
return  'Hello World' ;
});

HTTP Middleware

Application may be protected middleware - Middleware handles HTTP requests on the server and filter analysis. You can install middleware for verifying registered users, and to avoid problems such as cross-site scripting (XSS) or other safety conditions.

input('age') <= 200) {

return redirect('home');

}

return $next($request);

}

  

Cache

Your application available a robust caching system, through its adjustment, allows the application to load more quickly, which can provide the best user experience to your users.

Cache::extend('mongo', function($app) {
return Cache::repository(new MongoStore);
});

  

Authentication

Safety is paramount. Laravel comes on as a local user authentication, and can use the "remember" option to remember the user. It also allows you some additional parameters such as, for example, whether to display active users.

if (Auth::attempt(['email' => $email, 'password' => $password, 'active' 
=> 1 ], $remember)) {
// The user is being remembered...
}

  

The kind of integration

Laravel Cashier meet all the needs you want to develop payment systems needs. In addition, it synchronizes and integrates user authentication system. So, you no longer need to worry about how the billing system which is integrated into the development.

$user = User::find(1);
$user>subscription('monthly')>create($creditCardToken);

  

Task Automation

Elixir is a Gulp allows us to use the definition of the task Laravel program interface, we can use Elixir define streamline CSS 
and JavaScript preprocessor. 
Elixir (function (Mix) { 
mix.browserify ( 'main.js'); 
});

  

encryption

A security application that can be done should the data be encrypted. Use Laravel, you can enable the security OpenSSL encryption algorithm AES256CBC to meet all your needs. Further, all the values ​​are encrypted by the detecting whether encryption information is changed codes signed.

use Illuminate\Contracts\Encryption\DecryptException;
try {
$decrypted = Crypt::decrypt($encryptedValue);
} catch (DecryptException $e) {
//
}

  

Event Processing

Custom application events, recording and listening very quickly. EventServiceProvider events listen contains a list of all events recorded on your application.

protected $listen = [
'App\Events\PodcastWasPurchased' => [
'App\Listeners\EmailPurchaseConfirmation',
],
];

  

Paging

In Laravel pagination it is very easy because it can generate a series of links to the current page according to the user's browser.

paginate(15);
return view('user.index', ['users' => $users]);
}
}

  

Object graph (ORM)

Laravel layer comprising a processing database, which is called the object graph Eloquent. Also this object graph also applies to PostgreSQL. 
Users the User :: WHERE = $ ( 'votes', '>', 100)> Take (10)> GET (); 
the foreach ($ $ User Users AS) { 
var_dump ($ User> name); 
}

  

unit test

Development of unit testing is a lot of time-consuming task, but it is the key to ensuring our application to maintain normal operation. Laravel PHPUnit execution unit may be used in the test.

visit('/')
>see('Laravel 5')
>dontSee('Rails');
}
}

  

Do list

Laravel provides the use of to-do list (to do list) complex, lengthy selection process in the background. It allows us to deal with some asynchronous processes without the need for continuous navigation users.

Guess you like

Origin www.cnblogs.com/it-hao/p/11723256.html