This is my AuthorController.php
<?php
namespace App\Http\Controllers;
use App\Models\Post;
use App\Models\Author;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;
use Illuminate\Support\Facades\Redirect;
use View;
use Input;
class AuthorController extends Controller {
public function index()
{
$author_name = Input::get('name');
$author_slug = Input::get('slug');
$author_bio = Input::get('bio');
$new_author = Author::create(array('name' => $author_name, 'slug' => $author_slug, 'bio' => $author_bio));
return Redirect::to('/');
}
}
?>
This is what's in my Routes file
Route::post('/create-author', [
'as' => 'create-author',
'uses' => 'AuthorController@index'
]);
I'm not quite sure what's wrong, I tried hardcoding something into the database with $new_author = Author::create(array('name' => 'John)); and it worked, would it be the directory in which the Input class is in relative to my AuthorController.php, which is in App\Controllers