Laravel is a popular open-source PHP MVC framework created in 2011. It includes features like Eloquent ORM, a query builder, routing, middleware, Blade templating, and more. Laravel uses Composer for dependency management. The framework's structure separates app logic, routes, views, and more into logical folders. Artisan provides a command-line interface to generate files and scaffolding. Eloquent provides an ActiveRecord implementation to easily interact with the database. Blade templates combine views with data. Middleware filters HTTP requests. The document then demonstrates installing Laravel, routing, middleware, Blade, Eloquent, and best practices.
Laravel is a popular open-source PHP framework created in 2011. It provides powerful features like Eloquent ORM, query builder, Blade templating engine and middleware that save developers time. The document discusses installing Laravel with Composer, the file structure, using Artisan commands, routing, middleware, Blade templates, Eloquent ORM for databases and CRUD operations. It recommends useful Laravel packages and provides best practices like separating controller logic from models and using CSRF protection.
- Laravel is a popular PHP MVC framework that provides tools like Eloquent ORM, Blade templating, routing, and Artisan CLI to help developers build applications faster.
- Key Laravel features include Eloquent for database access, Blade templating engine, routing system, middleware, and Artisan CLI commands for common tasks like migrations and seeding.
- The document discusses Laravel's file structure, installing via Composer, and provides best practices for coding with Laravel like avoiding large queries and using middleware, validation, and CSRF protection.
The document provides information about a PHP framework lecture on Laravel. It includes the course code, department, lecturer, semester, and lecture outline. The lecture covers an introduction to Laravel, installing and running the framework, the directory structure, routing basics, the view engine Blade, and creating views. Key points about Laravel are that it makes tasks like authentication and caching easy and offers a powerful tool called Artisan to perform repetitive tasks. Composer is used to manage Laravel dependencies.
Laravel is a powerful PHP web framework that provides tools like authentication, routing, caching and database migration out of the box. It uses an MVC architecture and Eloquent ORM for database access. Key features include its Artisan CLI, resource controllers, routing system and Blade templating engine. Laravel also includes facilities for caching, queues, events and security.
Laravel is a popular PHP framework that provides tools and libraries to build web applications. It includes features like an Artisan CLI, routing, middleware, resourceful controllers, Eloquent ORM, Blade templating, and migrations/seeding. Laravel uses Eloquent as its ORM, which allows developers to interact with databases using plain PHP objects. It also utilizes Blade templating for views, migrations for database schema changes, and Artisan CLI commands for common tasks like installing and updating Laravel.
Laravel is an open-source PHP web application framework that provides tools and features to build web applications easily, including a database abstraction layer, tools for dependency injection and an MVC architecture. The document discusses Laravel's features, how to install it by downloading XAMPP, Composer and Visual Studio Code, and describes Laravel's directory structure which separates core code, configurations, routes, storage and other elements into logical folders. Tutorial videos are provided to help learn Laravel.
A detailed overview of the laravel framework, created by Awulonu Obinna and presented at: Laravel Abuja.
Author details:
Twitter – https://www.twitter.com/awulonu_obinna
Facebook – https://www.facebook.com/awulonuobinna
GitHub – https://www.github.com/obinosteve
PHP frameworks provide basic functionality and an architecture for building projects. They promote code reuse and speed up development by reducing overhead code needed for tasks like database access, authentication, and validation. While frameworks have learning curves and performance costs, they make code easier to maintain. Popular PHP frameworks include Yii, CodeIgniter, Symfony, Laravel, and CakePHP, with each having their own strengths for different project needs and team sizes. Frameworks help developers build clean, reusable code by enforcing separation of logic and presentation using patterns like MVC.
Laravel is a popular PHP web framework created by Taylor Otwell in 2011. It follows the MVC pattern and simplifies development with modular structure, elegant syntax, and built-in features like routing, middleware, Blade templating, Eloquent ORM, and Artisan CLI. Laravel has a large community and is easy to learn and use due to its simplicity, modularity, and extensive built-in functionality that helps developers build cleaner code more efficiently.
This document provides an overview of various web development topics including: HTML vs CSS, DOM trees, JavaScript, PHP, frameworks, and templates. It discusses how HTML defines content while CSS handles presentation. JavaScript adds interactivity. PHP dynamically generates HTML on the server. Frameworks provide structure and utilities to speed development using patterns like MVC. Templates organize page layout. Frameworks offer benefits like file organization, security, and community support for teamwork. A variety of popular frameworks and template options are presented.
The document provides an introduction and overview of the Laravel framework. It discusses Laravel's features such as routing, controllers, models, views, migrations, and its use of the IoC container. It also covers installing Laravel, project structure, and tools such as Artisan commands, Tinker, and Homestead. Overall, the document introduces the key concepts and functionality of the Laravel PHP framework.
Introduction to Laravel Framework (5.2)Viral Solani
This document provides an overview of the Laravel PHP framework, including why it was created, its main features and components. Some key points:
- Laravel was created to guide developers to best practices and utilizes modern PHP features. It has an active community and good documentation.
- Its major components include routing, controllers, blade templating, Eloquent ORM, authentication, queues and more. It also uses Composer for dependency management.
- Other tools in the Laravel ecosystem help with deployment (Homestead, Forge), billing (Cashier), APIs (Lumen) and more. The framework is fully-featured but aims to be easy to learn and use.
Solr Recipes provides quick and easy steps for common use cases with Apache Solr. Bite-sized recipes will be presented for data ingestion, textual analysis, client integration, and each of Solr’s features including faceting, more-like-this, spell checking/suggest, and others.
Ruby on Rails is a full-stack web application framework written in Ruby. It uses the MVC pattern and convention over configuration principles. Rails makes it possible to develop database-backed web applications rapidly by minimizing configuration through conventions and providing scaffolding. Key Rails concepts include Active Record for ORM, migrations for schema changes, routing for URLs, controllers for application logic, views for presentation, and testing frameworks. Rails emphasizes productivity through conventions that reduce configuration overhead.
Ruby on Rails is a full-stack web application framework written in Ruby. It allows developers to build database-backed web applications rapidly using conventions like MVC pattern and follows "convention over configuration" principle. Rails includes features like Active Record (ORM), validations, migrations, scaffolding, routing and helpers to help develop web applications quickly. Testing is an important part of Rails development using tools like RSpec, Factory Girl, Cucumber and Capybara.
This document introduces CodeIgniter, an open source PHP web application framework based on the Model-View-Controller (MVC) pattern. It discusses why MVC frameworks are useful for building enterprise web applications. CodeIgniter provides features like routing, database access, form validation and security filtering to help structure applications and make tasks less tedious. The document outlines CodeIgniter's directory structure, controllers, views, helpers and libraries to demonstrate how it implements the MVC pattern.
Laravel is a popular PHP web application framework that provides tools and features to facilitate web development. It follows the model-view-controller (MVC) design pattern and includes features like template engines, security standards, libraries, and modularity. Laravel offers benefits like fast load times, perfect documentation, automated testing, and support for mail services and databases. It is an open source framework that allows for cost-effective and high-quality web development.
Laravel is a popular PHP framework that follows the MVC pattern. It provides features like authentication, authorization, scheduling, and templates to help speed up development. Some key tools for Laravel development include PHPStorm, Bitbucket, and packages for user verification, debugging, and backups. Laravel's popularity is due to its security, modularity, and large community support.
This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.
Object Oriented Programming with Laravel - Session 2Shahrzad Peyman
This document provides an overview of object-oriented programming concepts like encapsulation, inheritance and access levels. It also summarizes Laravel fundamentals like directory structure, configuration, routing and controllers. Key points covered include defining public, private and protected properties and methods, using a front controller pattern, caching configurations, and organizing controller classes to handle requests.
Laravel is a popular PHP framework that has grown significantly in recent years. It provides features like resource controllers, authentication, routing, testing and an ORM that make development faster. Laravel uses the MVC pattern to separate concerns. The model manages data, the view displays it, and the controller communicates between them. Its growing community and documentation have helped make it a top choice for PHP projects. Future releases continue enhancing its capabilities.
This document provides a high-level design proposal for Apache Drill from the OpenDremel team. It outlines four key design tenets: (1) supporting multi-tenant semantics internally without guest VMs, (2) being modular and customizable, (3) being hyper-elastic to exploit compute capacity, and (4) being efficient. It suggests an architecture with a single-tenant frontend and multi-tenant backend separated. It also provides details on the suggested designs for the frontend, CLI, REST gateway, and query compiler.
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Francis Alexander
The rise of NoSQL databases and their simplicity has made corporates as well as end users have started to move towards NoSQL,However is it safe?.Does NoSQL mean we will not have to worry about Injection attacks. Yes We Do. This paper concentrates on exploiting NoSQL DB’s especially with its reach towards Mongodb,Couchdb and Redis and automating it using the NoSQL Exploitation Framework.
PHP with Postgres SQL connection string and connectingPraveenHegde20
This document provides an introduction and overview of PHP and using it with PostgreSQL. It begins with an introduction to PHP as a scripting language well-suited for web development. It then covers installing PHP locally and connecting to a PostgreSQL database. The remainder of the document provides tutorials and examples on basic PHP syntax like variables, arrays, and forms as well as an example of connecting to a PostgreSQL database and querying it from within PHP code.
Ad
More Related Content
Similar to What-is-Laravel and introduciton to Laravel (20)
Laravel is an open-source PHP web application framework that provides tools and features to build web applications easily, including a database abstraction layer, tools for dependency injection and an MVC architecture. The document discusses Laravel's features, how to install it by downloading XAMPP, Composer and Visual Studio Code, and describes Laravel's directory structure which separates core code, configurations, routes, storage and other elements into logical folders. Tutorial videos are provided to help learn Laravel.
A detailed overview of the laravel framework, created by Awulonu Obinna and presented at: Laravel Abuja.
Author details:
Twitter – https://www.twitter.com/awulonu_obinna
Facebook – https://www.facebook.com/awulonuobinna
GitHub – https://www.github.com/obinosteve
PHP frameworks provide basic functionality and an architecture for building projects. They promote code reuse and speed up development by reducing overhead code needed for tasks like database access, authentication, and validation. While frameworks have learning curves and performance costs, they make code easier to maintain. Popular PHP frameworks include Yii, CodeIgniter, Symfony, Laravel, and CakePHP, with each having their own strengths for different project needs and team sizes. Frameworks help developers build clean, reusable code by enforcing separation of logic and presentation using patterns like MVC.
Laravel is a popular PHP web framework created by Taylor Otwell in 2011. It follows the MVC pattern and simplifies development with modular structure, elegant syntax, and built-in features like routing, middleware, Blade templating, Eloquent ORM, and Artisan CLI. Laravel has a large community and is easy to learn and use due to its simplicity, modularity, and extensive built-in functionality that helps developers build cleaner code more efficiently.
This document provides an overview of various web development topics including: HTML vs CSS, DOM trees, JavaScript, PHP, frameworks, and templates. It discusses how HTML defines content while CSS handles presentation. JavaScript adds interactivity. PHP dynamically generates HTML on the server. Frameworks provide structure and utilities to speed development using patterns like MVC. Templates organize page layout. Frameworks offer benefits like file organization, security, and community support for teamwork. A variety of popular frameworks and template options are presented.
The document provides an introduction and overview of the Laravel framework. It discusses Laravel's features such as routing, controllers, models, views, migrations, and its use of the IoC container. It also covers installing Laravel, project structure, and tools such as Artisan commands, Tinker, and Homestead. Overall, the document introduces the key concepts and functionality of the Laravel PHP framework.
Introduction to Laravel Framework (5.2)Viral Solani
This document provides an overview of the Laravel PHP framework, including why it was created, its main features and components. Some key points:
- Laravel was created to guide developers to best practices and utilizes modern PHP features. It has an active community and good documentation.
- Its major components include routing, controllers, blade templating, Eloquent ORM, authentication, queues and more. It also uses Composer for dependency management.
- Other tools in the Laravel ecosystem help with deployment (Homestead, Forge), billing (Cashier), APIs (Lumen) and more. The framework is fully-featured but aims to be easy to learn and use.
Solr Recipes provides quick and easy steps for common use cases with Apache Solr. Bite-sized recipes will be presented for data ingestion, textual analysis, client integration, and each of Solr’s features including faceting, more-like-this, spell checking/suggest, and others.
Ruby on Rails is a full-stack web application framework written in Ruby. It uses the MVC pattern and convention over configuration principles. Rails makes it possible to develop database-backed web applications rapidly by minimizing configuration through conventions and providing scaffolding. Key Rails concepts include Active Record for ORM, migrations for schema changes, routing for URLs, controllers for application logic, views for presentation, and testing frameworks. Rails emphasizes productivity through conventions that reduce configuration overhead.
Ruby on Rails is a full-stack web application framework written in Ruby. It allows developers to build database-backed web applications rapidly using conventions like MVC pattern and follows "convention over configuration" principle. Rails includes features like Active Record (ORM), validations, migrations, scaffolding, routing and helpers to help develop web applications quickly. Testing is an important part of Rails development using tools like RSpec, Factory Girl, Cucumber and Capybara.
This document introduces CodeIgniter, an open source PHP web application framework based on the Model-View-Controller (MVC) pattern. It discusses why MVC frameworks are useful for building enterprise web applications. CodeIgniter provides features like routing, database access, form validation and security filtering to help structure applications and make tasks less tedious. The document outlines CodeIgniter's directory structure, controllers, views, helpers and libraries to demonstrate how it implements the MVC pattern.
Laravel is a popular PHP web application framework that provides tools and features to facilitate web development. It follows the model-view-controller (MVC) design pattern and includes features like template engines, security standards, libraries, and modularity. Laravel offers benefits like fast load times, perfect documentation, automated testing, and support for mail services and databases. It is an open source framework that allows for cost-effective and high-quality web development.
Laravel is a popular PHP framework that follows the MVC pattern. It provides features like authentication, authorization, scheduling, and templates to help speed up development. Some key tools for Laravel development include PHPStorm, Bitbucket, and packages for user verification, debugging, and backups. Laravel's popularity is due to its security, modularity, and large community support.
This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.
Object Oriented Programming with Laravel - Session 2Shahrzad Peyman
This document provides an overview of object-oriented programming concepts like encapsulation, inheritance and access levels. It also summarizes Laravel fundamentals like directory structure, configuration, routing and controllers. Key points covered include defining public, private and protected properties and methods, using a front controller pattern, caching configurations, and organizing controller classes to handle requests.
Laravel is a popular PHP framework that has grown significantly in recent years. It provides features like resource controllers, authentication, routing, testing and an ORM that make development faster. Laravel uses the MVC pattern to separate concerns. The model manages data, the view displays it, and the controller communicates between them. Its growing community and documentation have helped make it a top choice for PHP projects. Future releases continue enhancing its capabilities.
This document provides a high-level design proposal for Apache Drill from the OpenDremel team. It outlines four key design tenets: (1) supporting multi-tenant semantics internally without guest VMs, (2) being modular and customizable, (3) being hyper-elastic to exploit compute capacity, and (4) being efficient. It suggests an architecture with a single-tenant frontend and multi-tenant backend separated. It also provides details on the suggested designs for the frontend, CLI, REST gateway, and query compiler.
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Francis Alexander
The rise of NoSQL databases and their simplicity has made corporates as well as end users have started to move towards NoSQL,However is it safe?.Does NoSQL mean we will not have to worry about Injection attacks. Yes We Do. This paper concentrates on exploiting NoSQL DB’s especially with its reach towards Mongodb,Couchdb and Redis and automating it using the NoSQL Exploitation Framework.
PHP with Postgres SQL connection string and connectingPraveenHegde20
This document provides an introduction and overview of PHP and using it with PostgreSQL. It begins with an introduction to PHP as a scripting language well-suited for web development. It then covers installing PHP locally and connecting to a PostgreSQL database. The remainder of the document provides tutorials and examples on basic PHP syntax like variables, arrays, and forms as well as an example of connecting to a PostgreSQL database and querying it from within PHP code.
CSS Adnaved with HTML abd complete StylesheetPraveenHegde20
This document provides notes for a course on programming languages for web applications. It covers the goals of the course, which include understanding how to program web servers and clients, examining differences between programming languages for web development with a focus on PHP and JavaScript, and learning how to use PHP, JavaScript, jQuery, XML, and potentially other languages. The notes also outline the topics that will be covered in each lecture, including introductions to web servers, HTML, and PHP as well as discussions of PHP program structure and data types.
Cascading Style Sheets (CSS) allow the separation of document structure (HTML) from presentation (layout, colors, fonts etc). CSS is applied through style sheets that can be external, embedded or inline. The CSS box model represents elements as boxes that can be styled with properties like width, height, padding, border and margin. CSS follows a cascade rule to determine which styles take precedence when multiple selections apply. Key CSS concepts covered include the use of selectors to target elements, inheritance of property values, and font properties like font-size and color.
Smart city engineering work using Internet of ThingsPraveenHegde20
This document is a course notebook for a class on designing smarter cities. It covers various topics related to smart city design and implementation. Some of the key topics discussed include defining what a smart city is, the need for smart cities, proposed smart city architectures, smart infrastructure and applications in various sectors like transportation, energy, healthcare and education. It also discusses building and home automation technologies like HVAC optimization, predictive maintenance, LED lighting control etc. that are important components of smart city infrastructure and design.
This document provides an overview of the Pig analytics tool. It describes what Pig is, how it compares to other tools, how to execute Pig programs and load/access data. Key concepts covered include the Pig Latin language, data types, operators, parameter substitution, and outputting results. The document also discusses MapReduce integration, complex data types, casting between types, and using the Grunt shell interface.
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingCeline George
The Accounting module in Odoo 17 is a complete tool designed to manage all financial aspects of a business. Odoo offers a comprehensive set of tools for generating financial and tax reports, which are crucial for managing a company's finances and ensuring compliance with tax regulations.
How to Subscribe Newsletter From Odoo 18 WebsiteCeline George
Newsletter is a powerful tool that effectively manage the email marketing . It allows us to send professional looking HTML formatted emails. Under the Mailing Lists in Email Marketing we can find all the Newsletter.
In this ppt I have tried to give basic idea about Diabetic peripheral and autonomic neuropathy ..from Levine textbook,IWGDF guideline etc
Hope it will b helpful for trainee and physician
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessMark Soia
Boost your chances of passing the 2V0-11.25 exam with CertsExpert reliable exam dumps. Prepare effectively and ace the VMware certification on your first try
Quality dumps. Trusted results. — Visit CertsExpert Now: https://www.certsexpert.com/2V0-11.25-pdf-questions.html
Odoo Inventory Rules and Routes v17 - Odoo SlidesCeline George
Odoo's inventory management system is highly flexible and powerful, allowing businesses to efficiently manage their stock operations through the use of Rules and Routes.
High-performance liquid chromatography (HPLC) is a sophisticated analytical technique used to separate, identify, and quantify the components of a mixture. It involves passing a sample dissolved in a mobile phase through a column packed with a stationary phase under high pressure, allowing components to separate based on their interaction with the stationary phase.
Separation:
HPLC separates components based on their differing affinities for the stationary phase. The components that interact more strongly with the stationary phase will move more slowly through the column, while those that interact less strongly will move faster.
Identification:
The separated components are detected as they exit the column, and the time at which each component exits the column can be used to identify it.
Quantification:
The area of the peak on the chromatogram (the graph of detector response versus time) is proportional to the amount of each component in the sample.
Principle:
HPLC relies on a high-pressure pump to force the mobile phase through the column. The high pressure allows for faster separations and greater resolution compared to traditional liquid chromatography methods.
Mobile Phase:
The mobile phase is a solvent or a mixture of solvents that carries the sample through the column. The composition of the mobile phase can be adjusted to optimize the separation of different components.
Stationary Phase:
The stationary phase is a solid material packed inside the column that interacts with the sample components. The type of stationary phase is chosen based on the properties of the components being separated.
Applications of HPLC:
Analysis of pharmaceutical compounds: HPLC is widely used for the analysis of drugs and their metabolites.
Environmental monitoring: HPLC can be used to analyze pollutants in water and soil.
Food chemistry: HPLC is used to analyze the composition of food products.
Biochemistry: HPLC is used to analyze proteins, peptides, and nucleic acids.
The *nervous system of insects* is a complex network of nerve cells (neurons) and supporting cells that process and transmit information. Here's an overview:
Structure
1. *Brain*: The insect brain is a complex structure that processes sensory information, controls behavior, and integrates information.
2. *Ventral nerve cord*: A chain of ganglia (nerve clusters) that runs along the insect's body, controlling movement and sensory processing.
3. *Peripheral nervous system*: Nerves that connect the central nervous system to sensory organs and muscles.
Functions
1. *Sensory processing*: Insects can detect and respond to various stimuli, such as light, sound, touch, taste, and smell.
2. *Motor control*: The nervous system controls movement, including walking, flying, and feeding.
3. *Behavioral responThe *nervous system of insects* is a complex network of nerve cells (neurons) and supporting cells that process and transmit information. Here's an overview:
Structure
1. *Brain*: The insect brain is a complex structure that processes sensory information, controls behavior, and integrates information.
2. *Ventral nerve cord*: A chain of ganglia (nerve clusters) that runs along the insect's body, controlling movement and sensory processing.
3. *Peripheral nervous system*: Nerves that connect the central nervous system to sensory organs and muscles.
Functions
1. *Sensory processing*: Insects can detect and respond to various stimuli, such as light, sound, touch, taste, and smell.
2. *Motor control*: The nervous system controls movement, including walking, flying, and feeding.
3. *Behavioral responses*: Insects can exhibit complex behaviors, such as mating, foraging, and social interactions.
Characteristics
1. *Decentralized*: Insect nervous systems have some autonomy in different body parts.
2. *Specialized*: Different parts of the nervous system are specialized for specific functions.
3. *Efficient*: Insect nervous systems are highly efficient, allowing for rapid processing and response to stimuli.
The insect nervous system is a remarkable example of evolutionary adaptation, enabling insects to thrive in diverse environments.
The insect nervous system is a remarkable example of evolutionary adaptation, enabling insects to thrive
GDGLSPGCOER - Git and GitHub Workshop.pptxazeenhodekar
This presentation covers the fundamentals of Git and version control in a practical, beginner-friendly way. Learn key commands, the Git data model, commit workflows, and how to collaborate effectively using Git — all explained with visuals, examples, and relatable humor.
Geography Sem II Unit 1C Correlation of Geography with other school subjectsProfDrShaikhImran
The correlation of school subjects refers to the interconnectedness and mutual reinforcement between different academic disciplines. This concept highlights how knowledge and skills in one subject can support, enhance, or overlap with learning in another. Recognizing these correlations helps in creating a more holistic and meaningful educational experience.
Understanding P–N Junction Semiconductors: A Beginner’s GuideGS Virdi
Dive into the fundamentals of P–N junctions, the heart of every diode and semiconductor device. In this concise presentation, Dr. G.S. Virdi (Former Chief Scientist, CSIR-CEERI Pilani) covers:
What Is a P–N Junction? Learn how P-type and N-type materials join to create a diode.
Depletion Region & Biasing: See how forward and reverse bias shape the voltage–current behavior.
V–I Characteristics: Understand the curve that defines diode operation.
Real-World Uses: Discover common applications in rectifiers, signal clipping, and more.
Ideal for electronics students, hobbyists, and engineers seeking a clear, practical introduction to P–N junction semiconductors.
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
The ever evoilving world of science /7th class science curiosity /samyans aca...Sandeep Swamy
The Ever-Evolving World of
Science
Welcome to Grade 7 Science4not just a textbook with facts, but an invitation to
question, experiment, and explore the beautiful world we live in. From tiny cells
inside a leaf to the movement of celestial bodies, from household materials to
underground water flows, this journey will challenge your thinking and expand
your knowledge.
Notice something special about this book? The page numbers follow the playful
flight of a butterfly and a soaring paper plane! Just as these objects take flight,
learning soars when curiosity leads the way. Simple observations, like paper
planes, have inspired scientific explorations throughout history.
2. We will learn today …
• What is Laravel ?
• Install Laravel 5 with Composer
• Files structure
• What is artisan and how does it save us
time?
• Routing and route types
• What is Middleware and how to use it?
• What is Blade ?
• Database and Eloquent ORM
• CRUD with validation and database
connection (practical task)
• Best practices when coding in Laravel
3. What is ?
• Laravel is MVC PHP framework created by Taylor Otwell in
2011
• Free open-source license with many contributors worldwide
• One of the best frameworks together with Symfony,
CodeIgniter, Yii
• Has powerful features, saving us time
• Uses Symfony packages
• Lets see some statistics
6. Features
• Eloquent ORM (object-relational mapping) – implements
ActiveRecord
• Query builder – helps you to build secured SQL queries
• Restful controllers – provides a way for separating the different
HTTP requests (GET, POST, DELETE, etc.)
• Blade template engine – combines templates with a data model to
produce views
• Migrations – version control system for database, update your
database easier
• Database seeding – provides a way to populate database tables
with test data used for testing
• Pagination – easy to use advanced pagination functionalities
• Forms security – provides CSRF token middleware, protecting all the
forms
7. Must have packages
• Laravel debugbar - https://github.com/barryvdh/laravel-debugbar
Great for debugging on local environment. Shows all the views, requests,
exceptions loaded for the current page.
• LaravelCollective – Forms & HTML - https://
laravelcollective.com/docs/master/html
Perfect for generating forms, inputs, script tags and style tags
• Laravel IDE Helper - https://github.com/barryvdh/laravel-ide-helper
The package helps your IDE with autocomplete and autosuggest methods,
views, functions and more.
8. Let’s install Laravel
• Laravel uses Composer to manage its
dependencies
• Composer is dependency management tool for
PHP, like a library full of books
• NOT like Yum or apt
• Per project tool (vendor folder), not per system
• Install by using the command:
composer create-project --prefer-dist
laravel/laravel laravel-softuni
9. The structure
app/Http folder contains the Controllers,
Middlewares and Kernel file
All the models should be located in
app/Models folder
All the config files are located in
app/config folder
The service providers that are
bootstrapping functions in our app are
located in app/Providers folder
10. Database folder contains the
migrations and seeds
The public folder is the actual folder you
are opening on the web server.
All JS / CSS / Images / Uploads are located
there.
The resources folder contains all the
translations, views and assets (SASS,
LESS, JS)
that are compiled into public folder
The routes folder contains all the routes
for the project
All the logs / cache files are located in
storage folder
The vendor folder contains all the
composer packages (dependencies)
11. Artisan !
• Artisan is command-line interface for
Laravel
• Commands that are saving time
• Generating files with artisan is
recommended
• Run php artisan list in the console
12. Routing
• The best and easy routing system I’ve seen
• Routing per middleware / prefix or namespace
• Routing per request method (GET, POST, DELETE, etc.)
• ALWAYS name your route !
• Be careful with the routing order !
• Let’s see routing examples
13. Middleware
• The middleware is mechanism for
filtering the HTTP requests
• Laravel includes several
middlewares – Authentication,
CSRF Protection
• The auth middleware checks if the
user visting the page is
authenticated through session
cookie
• The CSRF token protection
middleware protects your
application from cross-site request
forgery attacks by adding token
key for each generated form
• Let’s create middleware
14. Blade
• Blade is the powerful template engine provided by
Laravel
• All the code inside blade file is compiled to static html
file
• Supports plain PHP
• Saves time
• Better components mobility, extend and include
partials
• Let’s take a look at few examples
15. Eloquent & Database
• The Eloquent ORM (Object-relational mapping) provides simple ActiveRecord
implementation for working with the database
$article = new Article();
$article->title = ‘Article title’;
$article->description =
‘Description’;
$article->save();
INSERT INTO `article` (`title`, `description`) VALUES (‘Article title’,
‘Description’);
16. • Each table has its own “Model”. You can use the model to read, insert, update or
delete row from the specific table
• Let’s check one model
17. Practical task
We will play with Laravel and create CRUD for recipes (Create, Read, Update,
Delete).
The recipe will have the following columns / fields :
• Id – primary key – not null
• Title – varchar – 255 length – not null
• Description – text – nullable
• Status – enum [ active / inactive ] – not null – defaults to active
• Created At – datetime – not null
• Updated At – datetime – not null
18. Best practices in Laravel
NEVER write queries or model logic inside the controller! The
controller job is to communicate with the model and pass data
to the view.
19. Views mobility
Extend and include partials. For example share
the same form fields on 2 pages – add and edit
20. Forms security
Always use the CSRF token protection that Laravel provides in forms you create, the
hackers will not be able to spam your forms and database
21. Database architecture
Be careful with the database architecture, always use the proper length for specific
column and never forget the indexes for searchable columns
22. Big query
• Avoid the big query unless
you really have to do it. The
big query is hard to debug
and understand.
• You can merge the small
queries into one to save the
CPU time on server, but
sometimes the query
becomes way too big.
23. Don’t forget the PHPDoc
Don’t forget to write comments for each method or complicated logic. The PHPDoc
comments are helping the IDE to autosuggest easier and the developers to
understand the piece of code