Some time we need concat multiple fields with pluck function in laravel Here we describe how use multiple columns in pluck function use of concat public function get_course() { $course_type = $_GET['course_type']; $courseArray = DB::table('courses')->where(['status' => 0, 'course_type' => $course_type]) ->orderBy('name', 'asc') ->pluck(DB::raw('CONCAT(name," -->",duration_in_month, " Months") AS name'),'id'); return json_encode($courseArray); }
Category Archives Laravel
By default, Laravel Eloquent models assume your table has timestamp fields – created_at and updated_at. But there’s plenty of things you can do to customize them or perform some interesting operations. Deepcool Fan Hub Control 4PWM Fan Speed Supports Fan with 3Pin/4Pin Cooling FH-04 If your database table doesn’t have those fields, and you will try to do something like…
I try again and again to test sending an email from local system (localhost) but I still cannot. Solution All you have to do is just edit in you.env file, that's it. MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=<your_email_address> MAIL_PASSWORD=<your_gmail_app_password_> MAIL_ENCRYPTION=ssl
12