Followings are some of useful code snippets of Laravel: 1). Show validation errors in view: @if($errors->has()) @foreach ($errors->all() as $error) <div>{{ $error }}</div> @endforeach @endif 2) Prevent errors by using the optional helper: When accessing object values, if that object is null, your code will raise an error. A simple way of avoiding errors is … Continue reading Laravel Helpful Code Snippets
Category: Laravel
If you found laravel project from github.com and you want to setup and use it locally, following are some helpful steps: Clone your projectGo to the folder application using cd command on your cmd or terminalRun composer install on your cmd or terminalCopy .env.example file to .env on the root folder. You can type copy … Continue reading How to install laravel project cloned from github
What is Middleware In Laravel, Middleware is the mechanism to apply any type of filtering you may need to HTTP requests to your application. Middleware works between request and response of our application.It sits between Request and Response like a firewall that examine whether to route a request.Laravel comes with several inbuilt middlewares like EncryptCookies … Continue reading Laravel Middleware
Laravel Route is a way of creating a request URL of your application. These URL do not have to map to specific files on a website. The best thing about these URL is that they are both human readable and SEO friendly. Routing is a core concept in Laravel, and it works a little differently … Continue reading Laravel Routing
Following are steps to install laravel in localhost server: Step 1: Visit the following URL and download composer to install it on your system. https://getcomposer.org/download/ Step 2: Open command prompt and browse to web server root directory or localhost folder (Assuming you have installed WAMP server in C:\wamp , open C:\wamp\www). Step 3: Type the following … Continue reading Laravel Installation
Followings are list of basic Concepts in Laravel: Routing Controllers Views Blade templating Requests and Responses Models & Migrations Middleware Eloquent ORM Routing: Routing means to accept the request and redirect it to appropriate function. Routing is a core concept in Laravel, and it works a little differently than some of the frameworks of the … Continue reading Laravel Basic Concepts
Question: What is Laravel? Laravel is a open-source PHP framework developed by Taylor Otwell used for Developing the websites. Laravel helps you create applications using simple, expressive syntax. Question: What are Advantages of Laravel? Easy and consistent syntax Set-up process is easy customization process is easy code is always regimented with Laravel Question: Explain about … Continue reading Laravel Interview Questions and Answers
What is Laravel? Laravel is a free, open source PHP web application framework, designed for the development of model–view–controller (MVC) web applications. Laravel is released under the MIT License, with its source code hosted on GitHub. Laravel is a web application framework with expressive, elegant syntax. Laravel attempts to take the pain out … Continue reading Laravel Introduction