[Laravel] 5 – Connect to MySQL

Database config In laravel 5, there is file ( /config/database.php ) controlling the database connection, however, modifying the default value is not suggested

It directly takes parameter from the env_variable and establish connection, therefore, we should modify the .env files located in root folder ( / )

  Controller and views   Targeted URL :     /routes/web.php Call the…

Continue Reading


[Lavarel] 4 – Blade template engine

  The command list needed for creating a simple blade template

  Under the /resouces/views/, there are

  main.blade.php The @yield declares the section layout called ‘content’

  contact.blade.php It extends the main.blade.php layout and pass data from @section to @endsection INTO the @yield


Laravel, PHP

[Lavarel] 3 – Pass data from Controller to View

/app/Http/Controllers/PagesController.php Method One -> with (“argName”, $variable);

Method Two ->withArgsName($variable);

Laravel, PHP

[Lavarel] 2 – Route and Controller basic



  There are three views under the directory, /resources/view/pages/, including: welcome.blade.php about.blade.php contact.blade.php

Laravel, PHP

[Lavarel] 1 – Route and views basic

Version 5.4.25 /routes/web.php

It simply links between the url “/about” to the about.blade.php under views folder, i.e. /resources/views/about.blade.php Check the result browsing