- FEATURES
- Autoload
- Class Reflection
- Magic Methods
- Exceptions
- Late Static Binding
- Type Hinting
- SPL
- PHPUNIT
- PHAR
- COMPOSER
- Carbon
- Guzzle
- Faker
- Math
- Requests
- DESIGN PATTERNS
- Singleton Pattern
- Observer Pattern
- Strategy Pattern
- Dependency Injection
- Middleware
- Registry
- SYMFONY
- Routes
- Annotations
- Flex
- Controllers
- Doctrine
- Templating
- VERSIONS
- Php7.4
- Php8.0
- SECURITY
- Filter Input
- Remote Code Injection
- Sql Injection
- Session Fixation
- File Uploads
- Cross Site Scripting
- Spoofed Forms
- CSRF
- Session Hijacking
- MODERN PHP
- Composer
- Autoloader
- Package
- Releases
- Generators
- Dependency Injection
- Middleware
- CUSTOM FRAMEWORK
- App
- Http Foundation
- Front Controller
- Routing
- Render Controller
- Resolver
- SoC
- FRAMEWORKS
- Slim
- Symfony V5
-
Laravel V8
- Laminas V3
- Codeigniter V4
Laravel
Version: Lavavel v8.5 Basics: Route, Controller, View
cd /var/www/tests.local/php/laravel/
composer create-project laravel/laravel myproject
sudo chown -R $USER:www-data storage
http://tests.local/php/laravel/myproject/public/
# Welcome page Laravel
Add user route
And user controller and view
// routes/web.php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UserController;
Route::get('/', function () {
return view('welcome');
});
Route::get('/user/{id}', // Look Here
[UserController::class, 'show']
);
// App\Http\Controllers\UserController.php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserController extends Controller
{
public function show($id)
{
return view('user', ['id' => $id]);
}
}
// resources/view/user.php
Hello user <?= $id ?>
It works!
http://tests.local/php/laravel/myproject/public/user/10
# Hello user 10
Last update: 126 days ago