Flare Laravel Error Tracking
Get all these insights and more when you sign up for FlareLearn more
This is a public shared error.
Laminas \ Db \ Adapter \ Exception \ InvalidQueryException
PHP 
Statement could not be executed (23000 - 1452 - Cannot add or update a child row: a foreign key constraint fails (`lms`.`student_course_logs`, CONSTRAINT `student_course_logs_lecture_id_foreign` FOREIGN KEY (`lecture_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE))
}
}
public function addRecord($data)
{
if($this->accountId){
$data['admin_id']= ADMIN_ID;
}
if ($this->timeStamp){
$data['created_at'] = Carbon::now()->toDateTimeString();
$data['updated_at'] = Carbon::now()->toDateTimeString();
}
$data = $this->clearInvalid($data);
$this->tableGateway->insert($data);
$id = $this->tableGateway->getLastInsertValue();
return $id;
}
public function update($data,$id){
if ($this->timeStamp){
$data['updated_at'] = Carbon::now()->toDateTimeString();
}
if($this->accountId && !GLOBAL_ACCESS){
$this->tableGateway->update($data,array($this->primary=>$id,'admin_id'=>ADMIN_ID));
}
else{
$this->tableGateway->update($data,array($this->primary=>$id));
}

App

Routing

Action
App\Http\Controllers\Student\CourseController@loglecture
Route name
student.course.loglecture
Middleware
  • web
  • auth
  • student

Browser

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

Request

http://localhost/public/student/course/loglecture
POST
curl "http://localhost/public/student/course/loglecture" \
   -X POST \
   -H 'host: localhost' \
   -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
   -H 'cookie: XSRF-TOKEN=eyJpdiI6Imd4Sk5WSUFGQk5Xcm9HanFZMnNJMFE9PSIsInZhbHVlIjoidi9XK3cyOXBQOVljczBVdFNhelNWb1JvOW5zMU5mQ3RzQWpGdUNLdDFzOWR2Z1gxUVovN0Uxa1pNRWRVSVhmSy9iYllRWWcySjZRTWM5cmhQcVVIaFo3VVVzUG5PRzJRbU5ua2F0cERXQ2cvNlUrUmZaaEdlNWtlZUw2c3J3dGsiLCJtYWMiOiI4NjllYzg1NzExODEwZTY4OGZiN2YwNzdjMGI5ZjU1ZjhjNDRiNTdhZDBkYTc3ZTc3NjY4OTQzMjgxYzU5NTcxIn0%3D; ccs_e_learning_session=eyJpdiI6IjR4SEJQZE0xSEJPbFJEZUZPY1Z6bGc9PSIsInZhbHVlIjoiS3R3K2M5NXJOSUNBSGZYUGdCbEViUUxWTDU1eDIwUnpUK2RoSDZ5eW02eVkrOVBPZkp4NEZwR0Y0dis2dnNVZFhKaUZERU5DWW1TVEdtZ01JNTlaYkYzalN6YVR4Y2hpcElZcUxBNE40VlBMdU5MSlk5RTZSZ1l3ZVpnczFuSXciLCJtYWMiOiIzNmU5MjcyZTFhNTU0NzQxYWNkZjQ0M2Q5NjVlZDUxNjkxZmUxODNhMTFiNWEzYjdkMjM0NDJjZjE4OTg2ODliIn0%3D' \
   -H 'origin: http://localhost' \
   -H 'referer: http://localhost/public/student/course/lecture/15/1' \
   -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"' \
   -H 'connection: keep-alive' \
   -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36' \
   -H 'content-type: application/x-www-form-urlencoded' \
   -H 'cache-control: max-age=0' \
   -H 'content-length: 73' \
   -H 'sec-fetch-dest: document' \
   -H 'sec-fetch-mode: navigate' \
   -H 'sec-fetch-site: same-origin' \
   -H 'sec-fetch-user: ?1' \
   -H 'accept-encoding: gzip, deflate, br' \
   -H 'accept-language: en-US,en;q=0.9' \
   -H 'sec-ch-ua-mobile: ?0' \
   -H 'sec-ch-ua-platform: "Windows"' \
   -H 'upgrade-insecure-requests: 1' \
   -F '_token=W9UsGGoT5Tp3Y4qD7YBhAwVKmyhS0E7QFCinXsau' -F 'course_id=1' -F 'lecture_id=15'

Headers

host
localhost
accept
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
cookie
XSRF-TOKEN=eyJpdiI6Imd4Sk5WSUFGQk5Xcm9HanFZMnNJMFE9PSIsInZhbHVlIjoidi9XK3cyOXBQOVljczBVdFNhelNWb1JvOW5zMU5mQ3RzQWpGdUNLdDFzOWR2Z1gxUVovN0Uxa1pNRWRVSVhmSy9iYllRWWcySjZRTWM5cmhQcVVIaFo3VVVzUG5PRzJRbU5ua2F0cERXQ2cvNlUrUmZaaEdlNWtlZUw2c3J3dGsiLCJtYWMiOiI4NjllYzg1NzExODEwZTY4OGZiN2YwNzdjMGI5ZjU1ZjhjNDRiNTdhZDBkYTc3ZTc3NjY4OTQzMjgxYzU5NTcxIn0%3D; ccs_e_learning_session=eyJpdiI6IjR4SEJQZE0xSEJPbFJEZUZPY1Z6bGc9PSIsInZhbHVlIjoiS3R3K2M5NXJOSUNBSGZYUGdCbEViUUxWTDU1eDIwUnpUK2RoSDZ5eW02eVkrOVBPZkp4NEZwR0Y0dis2dnNVZFhKaUZERU5DWW1TVEdtZ01JNTlaYkYzalN6YVR4Y2hpcElZcUxBNE40VlBMdU5MSlk5RTZSZ1l3ZVpnczFuSXciLCJtYWMiOiIzNmU5MjcyZTFhNTU0NzQxYWNkZjQ0M2Q5NjVlZDUxNjkxZmUxODNhMTFiNWEzYjdkMjM0NDJjZjE4OTg2ODliIn0%3D
origin
http://localhost
referer
http://localhost/public/student/course/lecture/15/1
sec-ch-ua
" Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
connection
keep-alive
user-agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
content-type
application/x-www-form-urlencoded
cache-control
max-age=0
content-length
73
sec-fetch-dest
document
sec-fetch-mode
navigate
sec-fetch-site
same-origin
sec-fetch-user
?1
accept-encoding
gzip, deflate, br
accept-language
en-US,en;q=0.9
sec-ch-ua-mobile
?0
sec-ch-ua-platform
"Windows"
upgrade-insecure-requests
1

Body

{
    "_token": "W9UsGGoT5Tp3Y4qD7YBhAwVKmyhS0E7QFCinXsau",
    "course_id": "1",
    "lecture_id": "15"
}

Session

cart
O:12:"App\Lib\Cart":10:{s:22:"App\Lib\Cartsessions";a:0:{}s:24:"App\Lib\CartisDiscount";b:0;s:22:"App\Lib\CartcouponId";N;s:29:"App\Lib\CartdiscountApplied";N;s:29:"App\Lib\CartpaymentMethodId";N;s:19:"App\Lib\Carttotal";N;s:23:"App\Lib\CartinvoiceId";N;s:27:"App\Lib\CarttransactionId";N;s:20:"App\Lib\CartuserId";N;s:21:"App\Lib\Cartpersist";b:1;}
_flash
{
    "new": [],
    "old": []
}
_token
W9UsGGoT5Tp3Y4qD7YBhAwVKmyhS0E7QFCinXsau
captcha
{
    "key": "eyJpdiI6IlN2aTNhcWQwUHNSMDN4N1hYL2YvcEE9PSIsInZhbHVlIjoiSUhXMTFLc2d1KysvaDBHekR2Q0hZR3c3aFE1cE4vd0dSa3owVStBbGVVRXhsZlBpclpyNmk5bitsSjZCeXh2MHlpa1hhdEErejIvWXliSmdVTFpCRVl6dFh0bFF1ME9hMkJDdlYvdVU4ZTA9IiwibWFjIjoiNTgzNDZmMjJkNzQ1MWYwYzUxYmM0YTk3NTY3YjE5YWVkMGY5ZDQ4NTAxNThhODkyNGRmMWUxM2U1MjZjMGZhNSJ9",
    "encrypt": true,
    "sensitive": false
}
redirect
/public/student/course/loglecture
_previous
{
    "url": "http://localhost/public/student/course/lecture/15/1"
}
login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d
3

Cookies

XSRF-TOKEN
W9UsGGoT5Tp3Y4qD7YBhAwVKmyhS0E7QFCinXsau
ccs_e_learning_session
sMyLYZl11wPqZmhQzW4ehbIamvxpd0Zbh0EcJCkN

Context

User

tvdagustin@gmail.com

tvdagustin@gmail.com

ID: 3

{
    "id": 3,
    "name": "Thelma",
    "email": "tvdagustin@gmail.com",
    "enabled": 1,
    "picture": null,
    "role_id": 2,
    "student": {
        "id": 2,
        "user_id": 3,
        "api_token": null,
        "created_at": "2022-03-05T08:44:07.000000Z",
        "updated_at": "2022-03-05T08:44:07.000000Z",
        "mobile_number": "09152589810",
        "token_expires": null
    },
    "last_name": "Agustin",
    "last_seen": null,
    "created_at": "2022-03-05T08:44:07.000000Z",
    "updated_at": "2022-03-09T15:36:36.000000Z",
    "billing_zip": null,
    "login_token": null,
    "billing_city": null,
    "billing_state": null,
    "billing_lastname": null,
    "billing_address_1": null,
    "billing_address_2": null,
    "billing_firstname": null,
    "email_verified_at": null,
    "billing_country_id": null,
    "login_token_expires": null
}

Versions

laravel version
8.20.1
Laravel locale
false
Laravel config cached
false
8:48:26 PM
Runtime 24.300032ms
Connection mysql
select * from information_schema.tables where table_schema = lms and table_name = settings and table_type = 'BASE TABLE'
8:48:56 PM
Runtime 0.410112ms
Connection mysql
select * from `settings` where `key` = general_ssl limit 1
8:48:57 PM
Runtime 0.260096ms
Connection mysql
select * from `settings` where `key` = general_admin_email limit 1
8:48:57 PM
Runtime 0.229888ms
Connection mysql
select * from `settings` where `key` = general_site_name limit 1
8:48:58 PM
Runtime 0.250112ms
Connection mysql
select * from `settings` where `key` = mail_protocol limit 1
8:48:58 PM
Runtime 0.27008ms
Connection mysql
select * from `settings` where `key` = config_language limit 1
8:48:59 PM
Runtime 0.229888ms
Connection mysql
select * from `templates` where `enabled` = 1 limit 1
8:49:01 PM
Runtime 0.450048ms
Connection mysql
select * from `templates` where `enabled` = 1 limit 1
8:49:02 PM
Runtime 0.359936ms
Connection mysql
select * from `templates` where `enabled` = 1 limit 1
8:49:03 PM
Runtime 0.499968ms
Connection mysql
select * from `settings` where `key` = config_language limit 1
8:49:04 PM
Runtime 0.450048ms
Connection mysql
select * from `settings` where `key` = config_baseurl limit 1
8:49:16 PM
Runtime 0.440064ms
Connection mysql
select * from `templates` where `enabled` = 1 limit 1
8:49:34 PM
Runtime 0.359936ms
Connection mysql
select * from `users` where `id` = 3 limit 1
8:49:50 PM
Runtime 0.43008ms
Connection mysql
select * from `students` where `students`.`user_id` = 3 and `students`.`user_id` is not null limit 1
8:49:52 PM
Runtime 0.250112ms
Connection mysql
select * from `courses` where `courses`.`id` = 1 limit 1