Class 'App\Http\Controllers\DB' not found and I also cannot use a new Model
Just add this top of your controller.
use DB;
Quick and dirty
use DB;
OR
\DB::table...
The problem here are PHP namespaces. You need to learn how to use them. As your controller are in App\Http\Controllers
namespace, if you refer any other class, you need to add leading backslash (or proper namespace) or add use
statement at the beginning of file (before class definition).
So in your case you could use:
$headquote = \DB::table('quotation_texts')->find(176);
$headquote = \App\Quotation::find(176);
or add in your controller class use
statement so the beginning of your controller class could look like this:
<?php
namespace App\Http\Controllers;
use DB;
use App\Quotation;
For more information about namespaces you could look at How to use objects from other namespaces and how to import namespaces in PHP or namespaces in PHP manual