Hi all I am a new of laravel 5.1,I just start learning laravel. I have problame in laravel I can not find the way to correct it I try to search but I still can not.
And here is my code: CourseController.php
public function update(Request $request, $id)
{
$input = $request->all();
$data = Course::findOrFail($id);
$data->update($input);
return redirect('course');
}
and my model Course.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Course extends Model
{
protected $table = "course";
protected $primaryKey = "course_id";
protected $fillable=[
'course_title',
'course_code',
'course_credite'
];
}
And my route
Route::resource('course','CourseController');
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire