− Laravel is an Open Source framework.. Laravel - Installation− Step 1 − Visit the following URL and download composer to install it on your system.. − Step 2 − After the Composer is in
Trang 1Nguy ễn Hữu Thể
PHÁT TRIỂN PHẦN MỀM NGUỒN MỞ
Trang 2− A powerful MVC PHP framework
− Designed for developers who need a simple and
elegant toolkit to create full-featured web
applications
− Laravel was created by Taylor Otwell
Trang 3− Laravel is a MVC framework.
• Incorporates many of the best features of frameworks like
CodeIgniter, Yii, ASP.NET MVC, Ruby on Rails, Sinatra,
and others
− Laravel is an Open Source framework
• It has a very rich set of features which will boost the speed
of Web Development
Trang 4Laravel – Features
− Modularity
− Testability
− Routing
− Configuration management
− Query builder and ORM (Object Relational Mapper)
− Schema builder, migrations, and seeding
− Template engine
− E-mailing
− Authentication
− Redis
− Queues
− Event and command bus
Trang 5Laravel – Version
5
Version Release date PHP version
1.0 June 2011
2.0 September 2011
3.0 February 22, 2012
3.1 March 27, 2012
3.2 May 22, 2012
Trang 6Laravel – Installation
− Server Requirements
• PHP >= 5.6.4
• OpenSSL PHP Extension
• PDO PHP Extension
• Mbstring PHP Extension
• Tokenizer PHP Extension
• XML PHP Extension
Trang 7Laravel - Installation
− Step 1 − Visit the following URL and download
composer to install it on your system.
− Step 2 − After the Composer is installed, check the
installation by typing the Composer command in the command prompt as shown in the following
screenshot.
Trang 8Laravel - Installation
− Step 3 − Move to path where you have created the
new directory and type the following command there
to install Laravel.
composer create-project prefer-dist laravel/laravel MyProject
Successfully:
Trang 9Laravel - Installation
− Step 4 − Open URL in the browser
http://localhost/MyProject
Or
http://localhost/MyProject/public
Trang 10− Public Directory
• Web server's document / web root to be the public directory
• The index.php in this directory serves as the front controller for all HTTP requests entering your application
− Configuration Files
• All of the configuration files for the Laravel framework are stored in the config directory
− Directory Permissions
• Directories within the storage and the bootstrap/cache
directories should be writable by your web server or Laravel will not run
Trang 11− Application Key
• Set your application key to a random string
• If you installed Laravel via Composer or the Laravel
installer, this key has already been set for you by the php
artisan key: generate command.
• Typically, this string should be 32 characters long
• The key can be set in the env environment file
• Renamed the env.example file to env
• If the application key is not set, your user sessions and other
encrypted data will not be secure!
Trang 12− Additional Configuration
• Timezone and locale
• Cache
• Database
• Session
https://laravel.com/docs/5.3/configuration#environment-configuration
Trang 13Application structure
− The default Laravel application structure is intended to
provide a great starting point for both large and small
applications
− You are free to organize your application however you like
− Laravel imposes almost no restrictions on where any given
class is located - as long as Composer can autoload the
class
Trang 14Root Directory
Laravel application JavaScript, CSS, Images,
localization and language files.
− routes - all of the route definitions for your
application By default, three route files are included
with Laravel: web.php, api.php, and console.php.
storage (cache), and application-generated logs.
Trang 15App Directory
− Console − All the artisan commands are
stored in this directory
− Exceptions − Contains your application's
exception handler
− Http − Contains your controllers, filters,
and requests
− Providers − Contains various service
providers