Fixed some things with the test add functions
This commit is contained in:
@ -49,13 +49,13 @@ class TestController extends Controller {
|
||||
$test->description = $params['test_description'];
|
||||
$test->component_id = $params['test_component'];
|
||||
|
||||
$test->save();
|
||||
|
||||
// attach benchmarks to test
|
||||
foreach ($params['test_benchmarks'] as $b) {
|
||||
$test->benchmarks()->attach($b);
|
||||
}
|
||||
|
||||
$test->save();
|
||||
|
||||
// redirect the user back to the home page
|
||||
$routeContext = RouteContext::fromRequest($request);
|
||||
$routeParser = $routeContext->getRouteParser();
|
||||
|
@ -16,7 +16,7 @@ class Test extends Model {
|
||||
return $this->hasMany(Result::class);
|
||||
}
|
||||
|
||||
public function benchmark() {
|
||||
public function benchmarks() {
|
||||
return $this->belongsToMany(Benchmark::class);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user