[01-01-2018, 1000, 400, 200],
["01-01-2018", 1000, 400, 200],
Tests {#538 ▼
#table: "tests"
#connection: null
#primaryKey: "id"
#keyType: "int"
#perPage: 15
+incrementing: true
+timestamps: true
#attributes: array:6 [▼
"id" => 2
"name" => "Тест по теме "О компании""
"description" => "Описание теста"
"category_id" => 36
"created_at" => "0000-00-00 00:00:00"
"updated_at" => "2018-03-19 11:03:32"
]
#original: array:6 [▼
"id" => 2
"name" => "Тест по теме "О компании""
"description" => "Описание теста"
"category_id" => 36
"created_at" => "0000-00-00 00:00:00"
"updated_at" => "2018-03-19 11:03:32"
]
#relations: []
#hidden: []
#visible: []
#appends: []
#fillable: []
#guarded: array:1 [▶]
#dates: []
#dateFormat: null
#casts: []
#touches: []
#observables: []
#with: []
#morphClass: null
+exists: true
+wasRecentlyCreated: false
}
public function getTest($category_id){
$category_id2 = 36;
If ($category_id==$category_id2) {
dd('равны');
}
$test = Tests::where('category_id','=',intval($category_id))->first();
return $test;
}
$test = Tests::where('category_id', 36)->first();
$test = Tests::where('category_id', intval($category_id))->first();