lewanay
266
7
Laravel

Laravel date error

Posted 2 months ago by lewanay

I am using query builder to fetch some data but for the created_at date I am using Carbon::parse(), but it's giving me error something like this:

DateTime::__construct(): Failed to parse time string

Can someone tell me what's wrong with this?

My query:

Carbon::parse(DB::table('students_attendances') ->join('students_classes', 'students_attendances.class_id', '=', 'students_classes.id') ->select('students_attendances.id', 'students_classes.class_name', 'students_attendances.created_at') ->orderBy('id', 'asc')->get())->toCookieString();

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.