nastuzzisamy / laravel-query-selector Goto Github PK
View Code? Open in Web Editor NEWA Laravel package that add some custom scopes on models to make a better selection via requests
License: MIT License
A Laravel package that add some custom scopes on models to make a better selection via requests
License: MIT License
Looking at the code, I found that I have to put the first day of the week/month to get a correct answer.
It should be documented, otherwise any day in the week should select the entire week!
Tout est dans le titre.
Par exemple :
/ma-route/?filter[firstname]=Rémy
!==
/ma-route/?filter[firstname]=Remy
!==
/ma-route/?filter[firstname]=rémy
C'est assez problématique si l'on veut faire une recherche.
I'm trying the week selection to optimize a reservation system ;p
The request:
http://website.com/events/?month=1
I'm recieving this:
{
"message": "An error occured when executing the selector month"
}
Here's the model's selection property:
protected $selection = [
'paginate' => null,
'order' => [
'default' => 'latest',
'columns' => [
'date' => 'begin_at',
],
],
'month' => [
'columns' => [
'begin' => 'begin_at',
'end' => 'begin_at',
],
],
'week' => [
'columns' => [
'begin' => 'begin_at',
'end' => 'begin_at',
],
],
'day' => [
'columns' => [
'begin' => 'begin_at',
'end' => 'begin_at',
],
],
'deleted' => 'without',
'filter' => [],
];
The call in the controller:
Event::getSelection();
Is there something wrong in this code?
When no content is found, the 416 HTTP Error Code is returned.
4xx means a client error.
If the request was correctly understood and processed, the 204 HTTP Success Code should be returned.
This last HTTP Code doesn't cause a JS exception!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.