Laravel “The PHP Framework For Web Artisans” By: - Ashish Kumar
Why Framework? (Legacy Code Problems) • Spaghetti Code • Limited Code Re-Use • Multiple Code Styles • Security vulnerabilities
What is Framework • An essential supporting structure of a building, vehicle, or object. • A basic structure underlying a system, concept, or text • Software Framework: – an abstraction in which software providing generic functionality can be selectively changed by additional user- written code, thus providing application-specific software • A software framework is 80% of your application already written for you.
Why Laravel ? • Taylor Otwall, a .NET developer in Arkansas (USA), was using an early version of CodeIgniter when the idea for Laravel came to him. • “I couldn't add all the features I wanted to” , he says, “without mangling the internal code of the framework”. • He wanted something leaner, simpler, and more flexible.
Trends of PHP Framework
Laravel?
Non-MVC Vs MVC
Model-View-Controller- Architecture
Model • it represents the data to the user. • This level defines where the application’s data objects are stored. • The model doesn’t know anything about views and controllers. So, whenever there are changes done in the model it will automatically notify observers that the changes are made. • The model may be a single object or a structure of objects.
Views • A view is a visual representation of the MVC model. • This level creates an interface to show the actual output to the user. • However, a view will not display anything itself. It is the controller or model that tells view what to display to the user. • It also handles requests from the user and informs controller.
Controller • Controller is a level which acts like a brain of the entire MVC system. • A controller also acts as a link between a user and the system. • The Controller is responsible for controlling the application logic and acts as the coordinator between the View and the Model. • The Controller receives an input from the users via the View, then processes the user's data with the help of Model and passes the results back to the View.
Benefits • Faster development process • Ability to provide multiple views • Loads Very fast • Modification does not affect the entire model • MVC model returns the data without formatting • SEO friendly Development platform
MVC - Laravel
THE EVOLUTION OF LARAVEL • Laravel 1 (6/2011) • Laravel 2 (11/2011) • Laravel 3 (2/2012) • Laravel 4 (5/2013) • Laravel 5 (2/2015) • Current Version is 5.5
Prerequisites
Course Items • Laravel Fundamentals – Installing Composer – Installing Laravel – Routing – Views – Databases – Creating tables – Migrations – Models – Blade • Creating a Login/Registration Web App – Project Source Code – Setting Up New Project – Seeding and displaying books – Login Form – Logging In – Laravel Filters – User Registration
Composer • It’s not a package Manager • It’s a dependency manager • It deals with packages or libraries but it manage on a per-project basis. • PHP 5.3.2+ to run • To test(command): – Composer –v
Laravel 5.5 Installation • Server Requirement – PHP >= 7.0.0 – OpenSSL PHP Extension – PDO PHP Extension – Mbstring PHP Extension – Tokenizer PHP Extension – XML PHP Extension • Via Composer: – composer global require "laravel/installer” – laravel new blog – Composer install

Laravel session 1

  • 1.
    Laravel “The PHP FrameworkFor Web Artisans” By: - Ashish Kumar
  • 2.
    Why Framework? (Legacy CodeProblems) • Spaghetti Code • Limited Code Re-Use • Multiple Code Styles • Security vulnerabilities
  • 3.
    What is Framework •An essential supporting structure of a building, vehicle, or object. • A basic structure underlying a system, concept, or text • Software Framework: – an abstraction in which software providing generic functionality can be selectively changed by additional user- written code, thus providing application-specific software • A software framework is 80% of your application already written for you.
  • 4.
    Why Laravel ? •Taylor Otwall, a .NET developer in Arkansas (USA), was using an early version of CodeIgniter when the idea for Laravel came to him. • “I couldn't add all the features I wanted to” , he says, “without mangling the internal code of the framework”. • He wanted something leaner, simpler, and more flexible.
  • 5.
    Trends of PHPFramework
  • 6.
  • 7.
  • 8.
  • 9.
    Model • it representsthe data to the user. • This level defines where the application’s data objects are stored. • The model doesn’t know anything about views and controllers. So, whenever there are changes done in the model it will automatically notify observers that the changes are made. • The model may be a single object or a structure of objects.
  • 10.
    Views • A viewis a visual representation of the MVC model. • This level creates an interface to show the actual output to the user. • However, a view will not display anything itself. It is the controller or model that tells view what to display to the user. • It also handles requests from the user and informs controller.
  • 11.
    Controller • Controller isa level which acts like a brain of the entire MVC system. • A controller also acts as a link between a user and the system. • The Controller is responsible for controlling the application logic and acts as the coordinator between the View and the Model. • The Controller receives an input from the users via the View, then processes the user's data with the help of Model and passes the results back to the View.
  • 12.
    Benefits • Faster developmentprocess • Ability to provide multiple views • Loads Very fast • Modification does not affect the entire model • MVC model returns the data without formatting • SEO friendly Development platform
  • 13.
  • 14.
    THE EVOLUTION OFLARAVEL • Laravel 1 (6/2011) • Laravel 2 (11/2011) • Laravel 3 (2/2012) • Laravel 4 (5/2013) • Laravel 5 (2/2015) • Current Version is 5.5
  • 15.
  • 16.
    Course Items • LaravelFundamentals – Installing Composer – Installing Laravel – Routing – Views – Databases – Creating tables – Migrations – Models – Blade • Creating a Login/Registration Web App – Project Source Code – Setting Up New Project – Seeding and displaying books – Login Form – Logging In – Laravel Filters – User Registration
  • 17.
    Composer • It’s nota package Manager • It’s a dependency manager • It deals with packages or libraries but it manage on a per-project basis. • PHP 5.3.2+ to run • To test(command): – Composer –v
  • 18.
    Laravel 5.5 Installation •Server Requirement – PHP >= 7.0.0 – OpenSSL PHP Extension – PDO PHP Extension – Mbstring PHP Extension – Tokenizer PHP Extension – XML PHP Extension • Via Composer: – composer global require "laravel/installer” – laravel new blog – Composer install

Editor's Notes

  • #2 What is Artisans: A worker in skilled trade, especially one that involves making things by hand.
  • #7 In computer science, syntactic sugar is syntaxwithin a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer.
  • #18 Suppose: You have a project that depends on a number of libraries. Some of those libraries depend on other libraries. Composer: Enables you to declare the libraries you depend on. Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project).
  • #19 Mbstring stands for multi-byte string functions. Mbstring is an extension of php used to manage non-ASCII strings. Mbstring is used to convert strings to different encodings. Multibyte character encoding schemes are used to express more than 256 characters in the regular byte wise coding system. Tokenization is the act of breaking up a sequence of strings into pieces such as words, keywords, phrases, symbols and other elements called tokens. Tokens can be individual words, phrases or even whole sentences. In the process oftokenization, some characters like punctuation marks are discarded.