Laravel 10 is getting a long-awaited feature to get the raw SQL query, including bindings.
The post Raw Query Output With Bindings is Coming to Laravel 10 appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
01 July, 2023
30 June, 2023
Pines: An Alpine and Tailwind UI Library
Programing Coderfunda
June 30, 2023
No comments
Pines UI is an Alpine and Tailwind UI Library by Tony Lea. Pines is a library of animations, sliders, tooltips, accordions, modals, and more!
The post Pines: An Alpine and Tailwind UI Library appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
29 June, 2023
ModuleNotFoundError: No module named '_psutil_osx'
Programing Coderfunda
June 29, 2023
No comments
When I wanted to import '_psutil_osx' ,Error happend.
This is the clause
import _psutil_osx
and the error
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named '_psutil_osx'
And I confirmed that I have installed psutil, that's the result of pip list
Package Version
---------- -------
pip 23.1.2
psutil 5.9.5
PyGreSQL 5.2.4
PyYAML 6.0
setuptools 67.6.1
six 1.16.0
wheel 0.40.0`
ps: I runned this on Apple Silicon (M1)
I want to import _psutil_osx success
28 June, 2023
Generate Code in Laravel with Synth
Programing Coderfunda
June 28, 2023
No comments
The Synth package for Laravel that helps you generate code and perform various tasks in your Laravel application.
The post Generate Code in Laravel with Synth appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
27 June, 2023
Mongoose. Remove fields on save that are not present in schema
Programing Coderfunda
June 27, 2023
No comments
I have a doc saved in MongoDB like this:
{
title: 'title',
author: 'author name',
body: 'the body',
admin: 'admin user'
}
And this is the schema in Mongoose:
var blogSchema = new Schema({
title: String,
author: String,
body: String
});
I would like that on save, the "admin" field was removed from the doc, is this possible? Can I automatize this in event pre-save?
Thanks.
26 June, 2023
Meta Whatsapp messages API can't send template with image header
Programing Coderfunda
June 26, 2023
No comments
I'm trying to send message templates through meta's Whatsapp messges API. I can successfully send templates with text variables but not with media elements such as a header image. When I try send the request I get the expected response with a wamid for the sent message but I never get a status update on this message or any info of why it didn't arrive (the message never makes it to the other end).
For normal text messages and other non-media templates I do get status updates correctly on my webhook. I've been readying their documentation and it's all over the place, i've been trying everything.
This is an example of the body from my request (everything else is correct [auth token etc..]).
body: {
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE_NUMBER",
"type": "template",
"template": {
"name": "request_permission",
"language": {
"code": "LANGUAGE_CODE"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "image",
"image": {
"link": "https://www.gstatic.com/webp/gallery3/1.sm.png"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "TEXT_STRING"
},
{
"type": "text",
"text": "TEXT_STRING"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": "0",
"parameters": [
{
"type": "payload",
"payload": "PAYLOAD"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": "1",
"parameters": [
{
"type": "payload",
"payload": "PAYLOAD"
}
]
}
]
}
}
Meta docs: https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#template-messages
I tried with different URLs for the image file, different formats and sources, on their own docs they have internet urls (without token protection) and it's supposed to work. I still got the same issue.
Edit:
Apparently, issues with message templates have been reported since 2 weeks ago and although the bug has been identified and assigned it hasn't been resolved. Users have been having issues with delays and failed message delivery with custom templates.
Bug URL: https://developers.facebook.com/support/bugs/587271766844244/
25 June, 2023
onVisitHighlightedLine cannot push classname using Rehype Pretty code
Programing Coderfunda
June 25, 2023
No comments
I'm using Rehype Pretty code to add syntax highlighting to my MDX blog. But I'm not able to get the line highlighting to work.
As per the documentation and few other resources, below is the configuration that should work, but I'm getting the following error.
_mdx_bundler_entry_point-f0976fc3-b34d-45fd-a559-565325298b22.mdx:0:0: ERROR: [plugin: @mdx-js/esbuild] TypeError: Cannot read properties of undefined (reading 'push') at onVisitHighlightedLine
const options = {
theme: 'one-dark-pro', // 'github-dark-dimmed' is default
onVisitLine(node) {
// Prevent lines from collapsing in `display: grid` mode, and allow empty
if (node.children.length === 0) {
node.children = [{ type: "text", value: " " }]
}
},
onVisitHighlightedLine(node) {
node.properties.className.push("line--highlighted");
},
onVisitHighlightedWord(node) {
node.properties.className = ["word--highlighted"]
},
};


