Use PostgreSQL native full text search in Laravel Scout with this community package.
The post PostgreSQL Full Text Search for Laravel Scout appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
06 May, 2023
05 May, 2023
Lemon Squeezy for Laravel
Programing Coderfunda
May 05, 2023
No comments
Lemon Squeezy for Laravel is an upcoming package to easily integrate checkout, subscriptions, and more.
The post Lemon Squeezy for Laravel appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
04 May, 2023
Small but powerful CLI apps with Minicli
Programing Coderfunda
May 04, 2023
No comments
Building CLI applications can be a lot of fun. We don't have to worry about the UI, and we can write beautiful PHP code that doesn't need any build steps.
The post Small but powerful CLI apps with Minicli appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
03 May, 2023
LDAP Framework for PHP
Programing Coderfunda
May 03, 2023
No comments
LdapRecord is a full-featured LDAP framework LdapRecord is a framework that helps you quickly integrate LDAP into your PHP applications.
The post LDAP Framework for PHP appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
02 May, 2023
Use ChatGTP to ask a question to the Laravel Docs
Programing Coderfunda
May 02, 2023
No comments
Ask a Question to the Laravel docs is a new project that uses ChatGTP to generate answers to your questions from the official Laravel documentation.
The post Use ChatGTP to ask a question to the Laravel Docs appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
---
01 May, 2023
Why does caching feels slower?
Programing Coderfunda
May 01, 2023
No comments
My app runs a lot of identical queries on small tables with less than 10 items. The tables are like statuses for orders.
ID
value
1
pending
2
taken
for example
When I run the following code, I get a weird output. $timer = new Timer(); echo 'normal
'; $timer->start(); for ($i = 0; $i < 1; $i++) { Status::all(); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 10; $i++) { Status::all(); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 100; $i++) { Status::all(); } echo $timer->stop()->asString() . "
"; echo 'cache
'; $timer->start(); for ($i = 0; $i < 1; $i++) { Cache::remember('Status', now()->addMinutes(10), function () { return Status::all(); }); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 10; $i++) { Cache::remember('Status', now()->addMinutes(10), function () { return Status::all(); }); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 100; $i++) { Cache::remember('Status', now()->addMinutes(10), function () { return Status::all(); }); } echo $timer->stop()->asString() . "
"; echo 'normal
'; $timer->start(); for ($i = 0; $i < 1; $i++) { Status::whereValue('pending')->get(); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 10; $i++) { Status::whereValue('pending')->get(); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 100; $i++) { Status::whereValue('pending')->get(); } echo $timer->stop()->asString() . "
"; echo 'cache
'; $timer->start(); for ($i = 0; $i < 1; $i++) { Cache::remember('Status', now()->addMinutes(10), function () { Status::whereValue('pending')->get(); }); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 10; $i++) { Cache::remember('Status', now()->addMinutes(10), function () { Status::whereValue('pending')->get(); }); } echo $timer->stop()->asString() . "
"; $timer->start(); for ($i = 0; $i < 100; $i++) { Cache::remember('Status', now()->addMinutes(10), function () { Status::whereValue('pending')->get(); }); } echo $timer->stop()->asString() . "
";
With this output normal 00:00.002 00:00.023 00:00.237 cache 00:00.015 00:00.150 00:01.516 normal 00:00.001 00:00.015 00:00.154 cache 00:00.014 00:00.153 00:01.518
Why does caching make the process 10 times slower? If caching isn't usable for small and simple queries, what should I do to improve my performance? submitted by /u/bububeti
[link] [comments]
30 April, 2023
How to manage data and perform CRUD operations on a "models" that are stored in YAML files rather than in my database?
Programing Coderfunda
April 30, 2023
No comments
I'm building an LMS and want to add a feature where tutors can create quizzes and students can attempt those quizzes.
I want the quizzes to be stored as YAML files rather than in my database (I'm using MySQL). The main two reasons being so that they can be easily version controlled and faster to retrieve.
Stack: - Breeze scaffolding (Vue & Inertia SSR) - Filament admin panel
My question is, since I don't have a quizzes table, is there still some way I can make a Quiz model?
Because it seems to me that I would instead have to make a Quiz class that doesn't extend Model and parses a given YAML file. Surely there must be some packages out there that allow you to work with models and Eloquent for data stored in flat-files.
Another approach I could try is installing Statamic into my project but seems a bit overkill to have both Filament and Statamic on the same project for what is essentially a single Statamic collection (Quizzes).
A Quiz entry might look something like this: title: "Algebra Quiz" author: 3 level: "Intermediate" subject: 2 topics: - Algebra questions: - question: "What is the equation of the line that passes through the points (2, 3) and (-1, 5)?" choices: - "y = 2x + 7" - "y = -2x + 7" - "y = 2x - 7" - "y = -2x - 7" answer: "y = -2x + 7" - question: "What is the value of x in the equation 3x - 7 = 14?" choices: - "7" - "9" - "11" - "15" answer: "7" - question: "What is the solution set for the equation 2x + 5 = 9?" choices: - "{2}" - "{2.5}" - "{3}" - "{3.5}" answer: "{2}"
Regarding author and subject fields, I'm not sure whether to store these as IDs as I did above, or with some UUID such as email for author and slug for subject. submitted by /u/lewz3000
[link] [comments]




