I am just trying to have my users table printed out onto a page. I am getting a Class 'Users' Not found in Laravel 4.2 - I have dump-autoloaded and clear-compiled.
My users.php is:
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password', 'remember_token');
}
My controller file reads (ive redacted code -- the issue is 100% this portion of code, as it works if I just pass messages to the view:
<?php
class SearchController extends BaseController {
public function search()
{
$search = Input::get("Search_Input");
$search_terms = explode(",", $search);
$search_query_type = Input::get("search_type");
$search_type = 'null';
if ($search_type === "Rep_Name") {
$users = Users::all();
return Redirect::to('/search')->with('users', $users);
}
}
My search view has this code:
@foreach($users as $name)
@endforeach
My database has a users table and a Name row.
The laravel.log error I get is:
[2016-04-28 19:32:30] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'Users' not found' in /home3/circates/public_html/jon/repform/app/controllers/SearchController.php:50
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire