I'd like to add a table in resources\views\welcome.blade.php. So I add the html table code there and it works. Then I try to edit app\Http\Controllers\HomeController.php to see a vardump in welcome.blade.php but nothing shows there, continue only my table.
Any ideas what I'm doing wrong? I'm new using laravel.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Model\ModelHome;
use App\User;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->objUser=new User();
$this->objBook=new ModelFuncionarios();
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
dd($this->objUser);
return view('home');
}
}
welcome.blade.php
buthome.blade.php
.dd(...)
is short for "dump & die" - it dumps the information and stops script execution. Also, you need to be logged in/auth'd to use HomeController, probably redirected you towelcome.blade.php
before executing yourindex
method – brombeer