Just sent my first-ever PR to the Laravel framework
added except() method to JsonResource class so you can easily exclude fields like:
Taylor Otwell reviewed it (yeah, that Taylor ๐) and said theyโll consider it for Laravel 13.
Didnโt get merged, but still feels awesome seeing my name in a Laravel PR thread ๐
Here's the link - https://github.com/laravel/framework/pull/57426
added except() method to JsonResource class so you can easily exclude fields like:
(new UserResource($user))->except(['email', 'profile.ssn']);
Taylor Otwell reviewed it (yeah, that Taylor ๐) and said theyโll consider it for Laravel 13.
Didnโt get merged, but still feels awesome seeing my name in a Laravel PR thread ๐
Here's the link - https://github.com/laravel/framework/pull/57426
GitHub
feat: Add exclude functionality to JsonResource by kalebalebachew ยท Pull Request #57426 ยท laravel/framework
Introduced a new protected property $excludes to hold attributes to be excluded from the resource array.
Added the except method to allow exclusion of specified attributes, supporting dot notation ...
Added the except method to allow exclusion of specified attributes, supporting dot notation ...
๐ฅ8
Ever wondered why we hash JWTs with a secret key if anyone can decode them anyway?
A JWT has three parts:
header.payload.signature
The header and payload are just Base64URL-encoded, not encrypted so yes, anyone can decode and read them. Thatโs intentional.
When a server receives a JWT, it recomputes the signature using its secret key and compares it to the tokenโs signature.
If someone changed even one letter in the payload like switching
to
the signatures wouldnโt match and the token would be rejected. so hashing a JWT with a key isnโt about secrecy itโs about authenticity.
It proves the data is real, untampered, and issued by someone who holds the secret.
A JWT has three parts:
header.payload.signature
The header and payload are just Base64URL-encoded, not encrypted so yes, anyone can decode and read them. Thatโs intentional.
When a server receives a JWT, it recomputes the signature using its secret key and compares it to the tokenโs signature.
If someone changed even one letter in the payload like switching
"role":"user"
to
"role":"admin"
the signatures wouldnโt match and the token would be rejected. so hashing a JWT with a key isnโt about secrecy itโs about authenticity.
It proves the data is real, untampered, and issued by someone who holds the secret.
๐ฅ5
Distributed Locks in microservices
lets say multiple microservices share one cache, things can get messy fast two services might try to refresh the same token or update the same record.
A distributed lock makes sure only one process touches a shared resource at a time.
Laravel example
Thatโs it.
You can safely run multiple workers or services only one will hold the lock at a time.
lets say multiple microservices share one cache, things can get messy fast two services might try to refresh the same token or update the same record.
A distributed lock makes sure only one process touches a shared resource at a time.
Laravel example
$lock = Cache::lock('cache-key', 10); // 10 seconds
if ($lock->get()) {
try {
// โ
Only one process gets here
$this->refreshToken();
} finally {
$lock->release();
}
} else {
// ๐ซ Another process is refreshing already
}Thatโs it.
You can safely run multiple workers or services only one will hold the lock at a time.
๐2
Forwarded from Hossiy Dev
Today I dialed *804# to check my balanceโฆ โณ
Then Ethio Telecom sent me a never-ending SMS ๐ฉ
Is that only me, or is anyone else frustrated by these giant messages too?
As a programmer ๐, instead of reading all this, I opened my PC and built this mini bot.
๐ Try it here: Tele Package Shortener
โค๏ธ React for more updates!
๐ Join our channel for more powerful resources:
Then Ethio Telecom sent me a never-ending SMS ๐ฉ
Is that only me, or is anyone else frustrated by these giant messages too?
As a programmer ๐, instead of reading all this, I opened my PC and built this mini bot.
๐ Try it here: Tele Package Shortener
โค๏ธ React for more updates!
๐ Join our channel for more powerful resources:
โค1๐ฅ1
Back with another open-source contribution ๐
I wanted to use the Laravel Audit Logger package for a project, Turns out, it didnโt support PostgreSQL which I needed for the setup.
I decided to build and add a Postgres driver myself.
and guess what the PR got merged .
Not bad for my first open-source merged PR ๐
Hereโs the PR thread โ github.com/iamfarhad/laravel-audit-log/pull/4
I wanted to use the Laravel Audit Logger package for a project, Turns out, it didnโt support PostgreSQL which I needed for the setup.
I decided to build and add a Postgres driver myself.
and guess what the PR got merged .
Not bad for my first open-source merged PR ๐
Hereโs the PR thread โ github.com/iamfarhad/laravel-audit-log/pull/4
GitHub
feat: add PostgreSQL driver support by kalebalebachew ยท Pull Request #4 ยท iamfarhad/laravel-audit-log
-Adds native PostgreSQL support to Laravel Audit Logger via a new PostgreSQLDriver The driver mirrors the MySQL implementation while using PostgreSQLโs jsonb columns and indexing for better perform...
๐ฅ7โค2
Forwarded from Shega Media
๐๐๐ต๐ถ๐ผ๐ฝ๐ถ๐ฎ๐ป ๐๐ถ๐ฟ๐น๐ถ๐ป๐ฒ๐ ๐๐ป๐ฎ๐ฏ๐น๐ฒ๐ ๐๐ฒ๐ฏ๐ถ๐ ๐๐ฎ๐ฟ๐ฑ ๐ฃ๐ฎ๐๐บ๐ฒ๐ป๐๐ ๐ง๐ต๐ฟ๐ผ๐๐ด๐ต ๐๐ต๐ฎ๐ฝ๐ฎโ๐ ๐ฃ๐ฎ๐๐บ๐ฒ๐ป๐ ๐๐ฎ๐๐ฒ๐๐ฎ๐
For the first time, travelers can book flights and purchase airline services directly using Ethiopian debit cards, traditionally used for ATM withdrawals.
The move expands the airlineโs digital payment ecosystem without having to establish individual integrations with each local bank.
The partnership also strengthens Chapaโs role in Ethiopiaโs fintech landscape by expanding its payment services across major industries.
๐๐๐น๐น ๐๐๐ผ๐ฟ๐.๐
https://shega.co/news/chapa-partners-with-ethiopian-airlines-to-enable-atm-card-payments-in-local-currency
For the first time, travelers can book flights and purchase airline services directly using Ethiopian debit cards, traditionally used for ATM withdrawals.
The move expands the airlineโs digital payment ecosystem without having to establish individual integrations with each local bank.
The partnership also strengthens Chapaโs role in Ethiopiaโs fintech landscape by expanding its payment services across major industries.
๐๐๐น๐น ๐๐๐ผ๐ฟ๐.๐
https://shega.co/news/chapa-partners-with-ethiopian-airlines-to-enable-atm-card-payments-in-local-currency
๐1
Hey! Weโre hiring a remote frontend intern (Ethiopia-based).
Weโre building something big with Next.js youโll make clean UIs and need to know how the web works. A bit of UI/UX skill helps.
No overqualified folks we want someone to grow with us.
โข 3K/month
โข Good shot at full-time
Send portfolio/resume to chord.addisvision@gmail.com. Letโs talk.
Weโre building something big with Next.js youโll make clean UIs and need to know how the web works. A bit of UI/UX skill helps.
No overqualified folks we want someone to grow with us.
โข 3K/month
โข Good shot at full-time
Send portfolio/resume to chord.addisvision@gmail.com. Letโs talk.
Forwarded from Samson Endale ๐ช๐น
GitHub
Prompt users to use --dev flag for development-only packages by SamAsEnd ยท Pull Request #407 ยท laravel/pint
This PR introduces a mechanism to significantly improve the developer experience by guiding users to correctly place development-only dependencies into the require-dev block. When a package is inte...
CORS is not your backend protecting origins.
Itโs the browser deciding whether to let JavaScript read a response
[Article Link]
Itโs the browser deciding whether to let JavaScript read a response
[Article Link]
Medium
You Probably Misunderstood CORS Hereโs the Full Explanation
Letโs be honest weโve all been there. You hit your API from React or Vue, see that damn CORS error, and immediately think:
๐ฅ2๐ฏ1
๐1
How many of you know about chapagram(@ChapagramBot) btw ?
- it lets you request money from your contacts
- split bills with your buddies.
- and there's a feature called shamo you should try out and many more.
- it lets you request money from your contacts
- split bills with your buddies.
- and there's a feature called shamo you should try out and many more.
๐ฅ1๐ค1