<?php namespace AppHttpControllers; use IlluminateHttpRequest; class ProductsController extends Controller{ public function index() { $title = "Welcome to my Laravel 8 course"; $description = "Created by Dary"; $data = [ 'productOne' => 'iPhone', 'productTwo' => 'Samsung' ]; //Compact method //return view('products.index', // compact('title', 'description)); //with method //return view('products.index')->with('title', $title); //Directly in the view return view('products.index', [ ]); } public function about() {