Example #1
0
/**
 *	Store a course modification
 *
 * @param $user : string
 * @param $author : user_id, default = Auth::user()->id
 * @param $value : user_id, default = Auth::user()->id
 *
 * @return response
 */
function makeCourseModification($user, $course, $value, $author = false)
{
    return App\CourseModification::create(['user_id' => $user, 'author_id' => $author == false ? Auth::user()->id : $author, 'course_id' => $course, 'value' => $value]);
}