Learning Laravel




Click here → How to install laravel


# mastering template, theme, blade ... php. blade.php 

here is my Laravel project folder Open in PhpStorm.




Make a Controller First: 

laravel controllers documant

we can create controller by shell
Laravel resource routing assigns the typical "CRUD" routes to a controller with a single line of code. For example, you may wish to create a controller that handles all HTTP requests for "photos" stored by your application. Using the make:controller Artisan command, we can quickly create such a controller:
php artisan make:controller PhotoController --resource
This command will generate a controller at app/Http/Controllers/PhotoController.php. The controller will contain a method for each of the available resource operations.

we make here 'WelcomeController.php' by -

go to → laravel project → Shift + Mouse Right Click


php artisan make:controller WelcomeController --resource


We got :





so,


above there are two types of route.


Route::get('/welcome', function () 
{
    return view('master');
});
this route direct return the View/display ... it can be used for only static pages.


Route::get('/','WelcomeController@index');
Route::get('/contact','WelcomeController@loadContactPage');
they are the perfect route  which go to the controller  and controller retun the view by the perfect way.
here 
'WelcomeController' is a controller  and  'index' /  '  loadContactPage'   are the methods .



how to link Any CSS/JS  file :



how to make an anchor/<a href=" "> to route →


How to return a View/Display page from Controller:- 









মন্তব্যসমূহ

এই ব্লগটি থেকে জনপ্রিয় পোস্টগুলি

SEO [Search Engine Optimization ] (সার্চ ইঞ্জিন অপ্টিমাইজেশান)

Web Scraping With PHP