Query database

Migration file example Read data with Models create a new model (found models inside app directory. Start laravel playground App\Project::all(); – show all records under project table (collection of items) App\Project::first(); – show all records on the first project. $project = new App\Project; $project->title = ‘my first project’; – insert Read more…

Databases and Migrations

All tables define as a classes. Migrations migration are like version control for your database. it’s quickly define a scheme for the a table without the need to learn any language. run the migrate: php artisan migrate if tables exists (drop the tables and recreate): php artisan migrate:fresh if any Read more…

Controllers

Let’s learn how to migrate from route closures to dedicated controllers create new controller: inside route/web.php add this line: inside html/controller: inside resources/views: directory projects (like example) add file index.blade.php Advance Controller *create controller with all Route Resource automatically *create controller & module automatically:

Passing Data Resources

@extends(‘layout’) – display page from resources/view/layout.blade.php @include(‘navbar’) – include the file from resources/view/navbar.blade.php @yield(‘content’) – read data from “section” @section(‘content’) – register section for contect @yield(‘content’)@endsection Use yield & section to pass data Passing page Title @section(‘title’) Welcome HomePage @endsection or you can use: @section(‘title’, ‘Welcome Homepage’) Passing Data between Read more…