Laravel for beginners
What is Laravel?
- Laravel is a PHP-based web framework for building high-end web applications using its significant and graceful syntaxes.
- Laravel is a PHP-based web framework for building high-end web applications using its significant and graceful syntaxes.
- It includes various characteristics of technologies like ASP.NET MVC, CodeIgniter, Ruby on Rails, and a lot more.
- This framework is an open-source framework.
- It facilitates developers by saving huge time and helps reduce the thinking and planning to develop the entire website from scratch.
About Laravel:
- Laravel was developed by Taylor Otwell in July 2011 and it was released more than five years after the release of the Codeigniter.
- Laravel is a PHP-based web framework like Codeigniter.
- Laravel is one of the open-source PHP frameworks.
- Laravel follows the model-view-controller (MVC) architectural pattern.
- Laravel is one of the most popular PHP frameworks after Codeigniter.
Features of Laravel:
- Routing controllers
- Configuration management
- Testability
- Authentication and authorization of users
- Modularity
- ORM (Object Relational Mapper) features
- Provides template engine
- Building schemas
- E-mailing facilities
What does laravel do?
- Route Handling
- Security Layer
- Models & DB migrations
- Views / Templates
- Authentication
- Sessions
- Compile assets
- Storage & File Management
- Error Handling
- Unit Testing
- Email & Config
- Cache Handling
What is a composer?
- Laravel implements composer for managing dependencies
URL to download composer
https://getcomposer.org/download/
How to set up Laravel?
- download the installer of Laravel with the help of Composer
composer global require "laravel/installer"
Laravel includes the Artisan CLI Commands:
- Creating controllers & models
- Creating database migration files and running migrations
- Create providers, events, jobs form requests, etc.
- Show routes
- Session commands
- Run tinker
- Create custom commands
Examples of Artisan Commands:
- $ php artisan list
- $ php artisan help migrate
- $ php artisan make:controller CrudController
- $ php artisan make:model Crud-m
- $ php artisan make:migration add_crud_to_db-table=crud
- $ php artisan migrate
- $ php artisan tinker
Eloquent ORM
- Laravel includes the eloquent object-relational mapper
Use App/Crud
$crud = new crud;
$crud->title = “New Crud”;
$crud->save();
Blade Template Engine:
Simple and powerful
Control structure (if-else, loops, etc)
Can you use
Template Inheritance: Extends layouts easily.
Can create custom components
stored in resources/views/layouts/app.blade.php
Install laravel app
composer create-project laravel/laravel crud app
- Make controller
- migrate database
Run laravel app
php artisan serve
Mirate Table into Database
php artisan migrate
Command to find laravel version
php artisan --version
The root directory structure of laravel
Directory App Bootstrap Config Database Public Resources Routes Storage Test vendor | Description The app directory holds the base code for your Laravel application. The bootstrap directory holds all the bootstrapping scripts used for your application The config directory holds all your project configuration files (.config) The database directory holds your database files The public directory helps in starting your Laravel project and also holds other scripts (JavaScript and CSS) as well along with images required for your project The resources directory holds all the Sass files, language (localization) files, templates (if any) The routes directory hold all your definition files for routing such as console.php, api.php, channels.php, etc The storage directory holds your session files, cache, compiled templates as well as miscellaneous files generated by the framework The test directory holds all your test cases The vendor directory holds all composer dependency files |
0 Replies to “Laravel Crash Course- For Beginners”
Leave a Reply
Your email address will not be published.