How dynamic caching data on laravel?
did you read laravel doc ?
Why you need help?
Are you new in laravel?
Is another way to validate a form?
How dynamic caching data on laravel?
Yes
I want create class to cache of database row and use on models
I’m glad
Why you need help?
By code i guess.
I already read it
public function store( FormRequest $request)
and you should define your validation rules in request class in rules function
Thank you
🙏🙏🙏
Very nice
Someone has written a robot with Larawl to create content on the site
no body?
actually
Just try $this
Puplic function store (Request $request){
$this->validate ($request, [
‘Content’ => ‘required’,
]);}
Meant this one
U dont know how to buy paid template to free
No. How?
U*
what he said is not that secret 😉
Hi
I have a table
points :
user_id -|- value
19534 -|- 20
19535 -|- 40
19534 -|- 20
19536 -|- 33
19530 -|- 33
19537 -|- 10
19537 -|- 1
SELECT s.order_id, @rank := @rank + 1 rank ,TotalPoints FROM (
SELECT order_id, sum(value) TotalPoints FROM points
GROUP BY order_id
) s, (SELECT @rank := 0) init
ORDER BY TotalPoints DESC
I use this query and get this
user_id -|- rank -|- sum(value)
19534 -|- 1 -|- 40
19535 -|- 2 -|- 40
19536 -|- 3 -|- 33
19530 -|- 4 -|- 33
19537 -|- 5 -|- 11
But i want this result
and i want to get rank for each user_id
like this
user_id -|- rank -|- sum(value)
19534 -|- 1 -|- 40
19535 -|- 1 -|- 40
19536 -|- 3 -|- 33
19530 -|- 3 -|- 33
19537 -|- 5 -|- 11
Help Thanks
Hi
I have a table
points :
user_id -|- value
19534 -|- 20
19535 -|- 40
19534 -|- 20
19536 -|- 33
19530 -|- 33
19537 -|- 10
19537 -|- 1
SELECT s.order_id, @rank := @rank + 1 rank ,TotalPoints FROM (
SELECT order_id, sum(value) TotalPoints FROM points
GROUP BY order_id
) s, (SELECT @rank := 0) init
ORDER BY TotalPoints DESC
I use this query and get this
user_id -|- rank -|- sum(value)
19534 -|- 1 -|- 40
19535 -|- 2 -|- 40
19536 -|- 3 -|- 33
19530 -|- 4 -|- 33
19537 -|- 5 -|- 11
But i want this result
and i want to get rank for each user_id
like this
user_id -|- rank -|- sum(value)
19534 -|- 1 -|- 40
19535 -|- 1 -|- 40
19536 -|- 3 -|- 33
19530 -|- 3 -|- 33
19537 -|- 5 -|- 11
Help Thanks
can use “group by sum(value)” ?
Sorry!
how can i found which user_id that have this sum(value) ??!
Application for testing and sharing SQL queries.
this is not my answer , It’s my query that i think its not true for me
http://sqlfiddle.com/#!9/be657c/37
SELECT s.order_id, TotalPoints,
@c := @c + 1 i ,
CASE
WHEN @prev_value = TotalPoints THEN @rank
WHEN @prev_value := TotalPoints THEN @rank := @c
END AS rank
FROM (
SELECT order_id, sum(value) TotalPoints
FROM points
GROUP BY order_id
) s,
(SELECT @rank := 0, @c := 0, @prev_value := NULL) init
ORDER BY TotalPoints DESC
Application for testing and sharing SQL queries.