Slide 1

Slide 1 text

Introduction to LARAVEL 14/03/2015

Slide 2

Slide 2 text

Mustapha Alaouy Full Stack Engineer | alaouy.com alaouym alaouy

Slide 3

Slide 3 text

Why I’m here today ? Laravel Because I’m in

Slide 4

Slide 4 text

We will …  Highlight the MVC parts of the framework  Discover the fun in using Laravel  Build a full featured blog in under 20 minutes

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Solution

Slide 7

Slide 7 text

Model-View-Controller Architectural Pattern

Slide 8

Slide 8 text

The pattern Model represents status and business logic of entities.

Slide 9

Slide 9 text

The pattern View is the visual representation of data.

Slide 10

Slide 10 text

The pattern Controller translates requests in commands and actions.

Slide 11

Slide 11 text

The pattern Controller is the entry point. Request is translated to action.

Slide 12

Slide 12 text

The pattern Controller may call one or many Models to fetch data.

Slide 13

Slide 13 text

The pattern Model fetches data from database and returns it to Controller.

Slide 14

Slide 14 text

The pattern Controller calls View and passes the fetched data to it.

Slide 15

Slide 15 text

The pattern View may fetch specific data from Model.

Slide 16

Slide 16 text

The pattern Once View is built, then it’s returned to Controller.

Slide 17

Slide 17 text

The pattern Network

Slide 18

Slide 18 text

The component Request /users will be routed to UsersController Router Network

Slide 19

Slide 19 text

WHY LARAVEL ?

Slide 20

Slide 20 text

Source : Google Trends

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Let’s get started

Slide 23

Slide 23 text

Installation Laravel utilizes Composer to manage its dependencies. So, before using Laravel, you will need to make sure you have Composer installed on your machine. > composer global require "laravel/installer=~1.1" > laravel new my_project

Slide 24

Slide 24 text

The Artisan CLI Artisan is the name of the command-line interface included with Laravel. It provides helpful commands for your use while developing your application. > php artisan list #List available commandes > php artisan help migrate #Show help for migrate > php artisan db:seed #Seed database > php artisan --version #Show version of Artisan

Slide 25

Slide 25 text

Controllers Basic & Restful

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

ORM Object-relational mapping

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Views Unleash the beauty

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

Migrations Change Database with no effort

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Seeds Populate your database easily

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

The Artisan CLI Database migrations and seeding using the artisan CLI > php artisan migrate:install #Create migrations table > php artisan migrate #Migrate database > php artisan migrate:rollback #Rollback migration > php artisan db:seed #Seed database

Slide 42

Slide 42 text

Relationships Between models O Dakchi

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

show me please!

Slide 48

Slide 48 text

Code will be available at Github.com/alaouy/blog-mphpa

Slide 49

Slide 49 text

Thank you I survived !