Hello I try to create post with Laravel, but I have this error :
Class AppHttpControllersPostConstroller does not exist
Route:
Route::get('/', function () {
return view('welcome');
});
Auth::routes(['verify' => true]);
Route::get('/home', 'HomeController@index')->name('home');
Route::get('/profile/{user}', 'ProfileController@show')->name('profile.show');
Route::get('/posts/create', 'PostConstroller@create')->name('posts.create');
Route::post('/posts', 'PostConstroller@store')->name('posts.store');
Controller:
<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
class PostController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function create()
{
return view('posts.create');
}
}
Model:
<?php
namespace App;
use IlluminateDatabaseEloquentModel;
class Post extends Model
{
public function user()
{
return $this->belongsTo('AppUser');
}
}
and I can do for leave this error?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…