Laravel - Tutorialspoint

3y ago
414 Views
109 Downloads
881.20 KB
24 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Noelle Grant
Transcription

Laravel

LaravelAbout the TutorialLaravel is a powerful MVC PHP framework, designed for developers who need a simple andelegant toolkit to create full-featured web applications. Laravel was created by TaylorOtwell. This is a brief tutorial that explains the basics of Laravel framework.AudienceThis tutorial will guide the developers and students who want to learn how to develop awebsite using Laravel. This tutorial is particularly meant for all those developers who haveno prior experience of using Laravel.PrerequisitesBefore you start proceeding with this tutorial, we make an assumption that you are familiarwith HTML, Core PHP, and Advance PHP. We have used Laravel version 5.1 in all theexamples.Copyright & Disclaimer Copyright 2016 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I)Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republishany contents or a part of contents of this e-book in any manner without written consentof the publisher.We strive to update the contents of our website and tutorials as timely and as precisely aspossible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of ourwebsite or its contents including this tutorial. If you discover any errors on our website orin this tutorial, please notify us at contact@tutorialspoint.comi

LaravelTable of ContentsAbout the Tutorial . iAudience . iPrerequisites . iCopyright & Disclaimer. iTable of Contents . ii1.LARAVEL – OVERVIEW . 1Introduction . 1Laravel – Features . 12.LARAVEL – INSTALLATION. 23.LARAVEL – APPLICATION STRUCTURE. 4Root Directory . 4App Directory . 54.LARAVEL – CONFIGURATION . 6Basic Configuration . 6Environmental Configuration . 6Database Configuration. 7Naming the Application. 8Maintenance Mode . 85.LARAVEL – ROUTING . 10Basic Routing. 10Routing Parameters . 136.LARAVEL — MIDDLEWARE . 16Define Middleware . 16Register Middleware . 17ii

LaravelMiddleware Parameters. 19Terminable Middleware . 227.LARAVEL – CONTROLLERS. 27Basic Controllers . 27Controller Middleware . 28Restful Resource Controllers . 33Implicit Controllers . 35Constructor Injection . 38Method Injection . 398.LARAVEL — REQUEST . 41Retrieving the Request URI . 41Retrieving Input . 439.LARAVEL – COOKIE . 47Creating Cookie . 47Retrieving Cookie . 4710. LARAVEL — RESPONSE . 51Basic Response . 51Attaching Headers . 51Attaching Cookies . 52JSON Response . 5311. LARAVEL — VIEWS . 54Understanding Views . 54Passing Data to Views . 55Sharing Data with all Views . 55Blade Templates. 57iii

Laravel12. LARAVEL — REDIRECTIONS. 61Redirecting to Named Routes. 61Redirecting to Controller Actions . 6213. LARAVEL — WORKING WITH DATABASE. 64Connecting to Database . 64Insert Records . 64Retrieve Records . 67Update Records . 70Delete Records . 7414. LARAVEL — ERRORS AND LOGGING . 78Errors . 78Logging . 7815. LARAVEL – FORMS . 7916. LARAVEL – LOCALIZATION . 8517. LARAVEL — SESSION . 89Accessing Session Data . 89Storing Session Data . 89Deleting Session Data . 8918. LARAVEL – VALIDATION . 9319. LARAVEL – FILE UPLOADING . 9820. LARAVEL – SENDING EMAIL . 10221. LARAVEL – AJAX . 10822. LARAVEL – ERROR HANDLING. 111HTTP Exceptions . 111iv

LaravelCustom Error pages . 11123. LARAVEL – EVENT HANDLING . 11424. LARAVEL – FACADES . 12225. LARAVEL – SECURITY . 128v

1. Laravel – OverviewLaravelIntroductionLaravel is an MVC framework with bundles, migrations, and Artisan CLI. Laravel offers a robustset of tools and an application architecture that incorporates many of the best features offrameworks like CodeIgniter, Yii, ASP.NET MVC, Ruby on Rails, Sinatra, and others.Laravel is an Open Source framework. It has a very rich set of features which will boost thespeed of Web Development. If you familiar with Core PHP and Advanced PHP, Laravel willmake your task easier. It will save a lot time if you are planning to develop a website fromscratch. Not only that, the website built in Laravel is also secure. It prevents the variousattacks that can take place on websites.Laravel – FeaturesLaravel offers the following key features: Modularity Testability Routing Configuration management Query builder and ORM (Object Relational Mapper) Schema builder, migrations, and seeding Template engine E-mailing Authentication Redis Queues Event and command bus6

2. Laravel – InstallationLaravelFor managing dependencies, Laravel uses composer. Make sure you have a Composerinstalled on your system before you install Laravel.Step 1: Visit the following URL and download composer to install it on your system.https://getcomposer.org/download/Step 2: After the Composer is installed, check the installation by typing the Composercommand in the command prompt as shown in the following screenshot.Step 3: Create a new directory anywhere in your sys

Laravel 10 resources: This directory contains raw assets such as the LESS & Sass files, localization and language files, and Templates that are rendered as HTML. storage: This directory contains App storage, like file uploads etc. Framework storage (cache), and application-generated logs. test: This directory contains various test cases. .

Related Documents:

3.5 Integrasi Bootstrap Di Laravel Hal : 10-14 4. Pembuatan CRUD Di Laravel 4.1. Create / Penambahan Data Di Laravel Hal : 15-18 4.2. Read / Menampilkan Data Di Laravel Hal : 19-20 3.3. Delete / Menghapus Data Di Laravel Hal : 21 4.4. Update / Mengubah Data Di Laravel Hal : 22-24

tutorialspoint.com or google.com these are domain names. A domain name has two parts, TLD (Top Level Domain) and SLD (Second level domain), for example in tutorialspoint.com, tutorialspoint is second level domain of TLD .com, or you can say it's a subdomain of .com TLD. There are many top level domains available, like .com,

Laravel Born in 2011 by Taylor Otwell MVC framework in PHP 83,000 sites Convention over configuration Attempts to make working with PHP a joy

Schema builder The Laravel Schema class provides a database agnostic (i.e. can function with a multi-tude of DBMS) way of managing all database related work such as creating or deleting tables and adding fields to an existing table. It works with a multitude of databases sys-t

Chapter1-GettingStarted A zombie developer is very slow at setting up a new project, whereas a Laravel developer can run a few commands to set up a new project in a matter of seconds!

Chapter 1, Design and Architectural Pattern Fundamentals, explains design and architectural pattern terms and explains the classification of these design patterns and their elements. This chapter provides some examples from the Laravel core code, which contains the design patterns

In this book you'll learn how to use the Laravel framework and Stripe to create a fairly simple yet most certainly real-world online store. You'll learn by doing, following along with the creation of an e-commerce site for a fictitious lawn care company named We Dew Lawns, Inc. In addition

Autodesk AutoCAD Architecture 2017 Fundamentals 3-1. Lesson 3 . Floor Plans . The floor plan is central to any architectural drawing. In the first exercise, we convert an AutoCAD 2D floor plan to 3D. In the remaining exercises, we work in 3D. Exercise 3-1: Going from a 2D to 3D Floor plan Drawing Name: New . Estimated Time: 45 minutes