Professional Documents
Culture Documents
A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's
computer. Each time the same computer requests a page with a browser, it will send the cookie too.
With PHP, you can both create and retrieve cookie values.
Syntax
setcookie(name, value, expire, path, domain, secure, httponly);
Create Cookie
<!DOCTYPE html>
<?php
$cookie_name = "user";
?>
<html>
<body>
<?php
if(!isset($_COOKIE[$cookie_name])) {
} else {
?>
<p><strong>Note:</strong> You might have to reload the page to see the value of the cookie.</p>
</body>
Laravel
Where can we find/ create Laravel file
In Laravel folder, there is a folder resources with sub folder views. Save file there wit .blade.php
extension
Creating route
Route::get('/', function () {
return view('welcome');
});
Creating Controller
Open cmd and change directory to Laravel folder path
cd C:\xampp\htdocs\Laravel\lar
Use of Laravel:
Laravel is primarily used for building custom web apps using PHP. It's a web framework that handles
many things that are annoying to build yourself, such as routing, templating HTML, and
authentication.
What is Laravel?
Laravel is an open-source widely used PHP framework. The platform was intended for the
development of web application by using MVC architectural pattern. Laravel is released under the
MIT license.
Composer
It is an application-level package manager for PHP. It provides a standard format for managing PHP
software dependencies and libraries.
What is a Route?
A route is basically an endpoint specified by a URI (Uniform Resource Identifier). It acts as a pointer
in Laravel application.
Most commonly, a route simply points to a method on a controller and also dictates which HTTP
methods are able to hit that URI.
PostgreSQL
SQL Server
SQLite
MySQL
Laravel Directories
Console
Contains all your Artisan commands
Http
Contains all your controllers, middleware, requests, and routes file
Providers
Contains all your application service providers. You can read more about Service Providers here
Events
Contains all your event classes
Exceptions
Contains your application exception handler and custom exception classes
Jobs
Contains all the jobs queued by your application
Listeners
Contains all the handler classes for your events
Policies
Contains the authorization policy classes for your application. Policies are used to determine if a user
can perform a given action against a resource.