Lecture 3
Lecture 3
===============
1. In laravel controller act as a directing traffic between Views and Models.
2. Controller is basically the central unit here we can write logic, call database
data,
call models , and also pass the view from the controller.
3. Create a controller :-
php artisan make:controller <controller_name>
6. We can create a function with the public private and protected access specifier,
by default this is
the public.
Example :- HomeController
--------------------------
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
7. Now lets define a route for this controller,so go to the web.php file and just
create the
route here.
Example :- web.api
------------------
use App\Http\Controllers\HomeController;