2. What is Laravel?
• • Laravel is a PHP framework for web
application development.
• • It provides an elegant syntax and follows
the MVC pattern.
• • Laravel simplifies common tasks like
authentication, routing, and caching.
• • It is open-source and has a strong
developer community.
3. Features of Laravel
• • MVC Architecture
• • Blade Templating Engine
• • Eloquent ORM (Object-Relational Mapping)
• • Built-in Authentication & Authorization
• • Artisan Console (Command Line Tool)
• • Database Migration System
• • API Support & Testing Features
4. Laravel Directory Structure
• • app/ - Contains the core application files
(Models, Controllers, etc.)
• • bootstrap/ - Bootstrapping the framework
• • config/ - Configuration files
• • database/ - Database migrations and
seeders
• • public/ - Entry point (index.php)
• • routes/ - Web and API routes
• • resources/ - Views, CSS, JavaScript files
5. Installation of Laravel
• 1. Install Composer (Laravel’s dependency
manager).
• 2. Run the command: `composer create-
project --prefer-dist laravel/laravel
myProject`.
• 3. Navigate to the project folder: `cd
myProject`.
• 4. Start the development server: `php artisan
serve`.
• 5. Open `http://127.0.0.1:8000` in a browser.
6. Laravel Routing Example
• • Laravel routes are defined in the
`routes/web.php` file.
• Example:
• ```
• Route::get('/hello', function () {
• return 'Hello, Laravel!';
• });
• ```
7. Blade Templating Engine
• • Blade is Laravel’s built-in templating
engine.
• • It allows reusability and dynamic content in
views.
• Example:
• ```
• @extends('layout')
• @section('content')
8. Eloquent ORM (Database
Handling)
• • Eloquent is Laravel’s ORM for database
interactions.
• • It allows developers to interact with
databases using PHP syntax.
• Example:
• ```
• $users = User::all();
• foreach ($users as $user) {
9. Conclusion
• • Laravel is a powerful and developer-
friendly PHP framework.
• • It provides built-in tools for authentication,
routing, and database management.
• • Blade templating and Eloquent ORM make
development easier.
• • Laravel is widely used for building modern
web applications.