Is this reset password table?

|
AlaaDq 2020-03-16 18:52:43
thank u
RayhanYulanda 2020-03-16 18:54:33
stefan_ssv 2020-03-16 18:33:50
Ehat is Start_date column type?

datetime

RayhanYulanda 2020-03-16 18:55:04
RayhanYulanda 2020-03-16 18:20:39
$now = Carbon::now();
$events = Event::where(‘start_date’,’=’,$now->format(‘Y-m-d’))
->get([‘id’, ‘title’, ‘start_date’, ‘end_date’, ‘venue_name’]);

i’m trying to get start today without compare the time but it didnt work. but if i change = into >= it will appear the right result

what should i do?

DesolatorMagno 2020-03-16 19:01:57
cast start_date as date, like created_at, to work with it easier.
stefan_ssv 2020-03-16 19:02:44
or use whereDate(‘start_date’,….)
RayhanYulanda 2020-03-16 19:14:00
stefan_ssv 2020-03-16 19:02:44
or use whereDate(‘start_date’,….)

i need using it with whereOr too. how is it? 😢

RayhanYulanda 2020-03-16 19:14:49
Event::where(‘start_date’, ‘<=’, $now)
->where(‘end_date’, ‘>=’, $now)
->orWhere(‘start_date’,$now->format(‘Y m d’))
->get([‘id’, ‘title’, ‘start_date’, ‘end_date’, ‘venue_name’]);
RayhanYulanda 2020-03-16 19:15:00
RayhanYulanda 2020-03-16 19:14:49
Event::where(‘start_date’, ‘<=’, $now)
->where(‘end_date’, ‘>=’, $now)
->orWhere(‘start_date’,$now->format(‘Y m d’))
->get([‘id’, ‘title’, ‘start_date’, ‘end_date’, ‘venue_name’]);

this is the full query

stefan_ssv 2020-03-16 19:16:54
Event::where(‘start_date’, ‘<=’, $now)
->where(‘end_date’, ‘>=’, $now)
->orWhereDate(‘start_date’,$now->format(‘Y m d’))
->get([‘id’, ‘title’, ‘start_date’, ‘end_date’, ‘venue_name’]);
RayhanYulanda 2020-03-16 19:22:50
stefan_ssv 2020-03-16 19:16:54
Event::where(‘start_date’, ‘<=’, $now)
->where(‘end_date’, ‘>=’, $now)
->orWhereDate(‘start_date’,$now->format(‘Y m d’))
->get([‘id’, ‘title’, ‘start_date’, ‘end_date’, ‘venue_name’]);

thanks a lot! it works 😊

Alireza1kazemi 2020-03-16 19:24:48
Guys
If I use vue routing
All of the post or get requests must be to api??
stefan_ssv 2020-03-16 19:29:43
RayhanYulanda 2020-03-16 19:22:50
thanks a lot! it works 😊

youre welcome

Nimit1906 2020-03-16 20:36:58
In relationships three tables and get only some fields using eloquent
mistersans 2020-03-16 20:39:27
im only beginner in Lara 6. I met some problems. I made simple project and i used Openserver. Then I posted it on my server and my project only shows index page, other buttons show errors. Why? Please help me! Sorry for my English
mistersans 2020-03-16 20:41:58
laravel_discuss-29851.jpg
local
mistersans 2020-03-16 20:42:09
laravel_discuss-29852.jpg
server
mistersans 2020-03-16 20:42:12
same code
Alireza1kazemi 2020-03-16 20:43:31
mistersans 2020-03-16 20:42:09
server

What’s your php version on server?

mistersans 2020-03-16 20:44:14
i don’t know, let me ask it from my sysadmin
mistersans 2020-03-16 20:46:00
Alireza1kazemi 2020-03-16 20:43:31
What’s your php version on server?

PHP 7.2.28 (cli) (built: Feb 18 2020 11:07:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Alireza1kazemi 2020-03-16 20:49:17
mistersans 2020-03-16 20:46:00
PHP 7.2.28 (cli) (built: Feb 18 2020 11:07:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

It looks Ok
Can you send a picture of your source code?

mistersans 2020-03-16 20:50:50
my source code is ok, because it works normal, but only local
mistersans 2020-03-16 20:51:29
i think the problem in the database connection
mistersans 2020-03-16 20:54:03
no, its impossible because it wont work locally on my PC
DesolatorMagno 2020-03-16 20:55:15
Is not imposible for a code to work locally but crash in the server.
DesolatorMagno 2020-03-16 20:55:40
There is a reason why you where asked the version.
DesolatorMagno 2020-03-16 20:56:45
I have a app that crashes under 7.3 because of a package that is used.
2589 2020-03-17 00:03:35
hey, i have a layout blade. and i have blade for header, how do i pass variable to this blade?
DesolatorMagno 2020-03-17 00:21:47
View composer
2589 2020-03-17 01:28:01
someone know how to fix this:
has exceeded the ‘max_connections_per_hour’ resource (current value: 500) (SQL: select count(*) as aggregate from `drawings`)
pringal7 2020-03-17 07:41:23
GRANT USAGE ON database_name.*
TO ‘root’@’localhost’
WITH MAX_QUERIES_PER_HOUR 1000
MAX_CONNECTIONS_PER_HOUR 100;
pringal7 2020-03-17 07:44:33
Run this in mysql command line
noneshort 2020-03-17 09:59:28
Hello masters
I have some issues :

There was an error while creating the signature: error:04088003:rsa routines:RSA_setup_blinding:BN lib

With laravel 5.6 on api routes
passport : 5.0

Please I need help

jjoek 2020-03-17 10:20:21
Anyone whose integrated a Laravel app with Microsoft Dynamics please dm
Genius_29 2020-03-17 10:54:50
I create a form with 4 inputs fields which make a calculation to a controller and I get those data during manipulation so how to I pass those data to view.
2020-03-17 11:27:14
pls guys who can help me with laravel 7 tutorial
Genius_29 2020-03-17 11:47:14
2020-03-17 11:27:14
pls guys who can help me with laravel 7 tutorial

laravel 7 tutorial #1 installationYouTube
In this laravel 7 tutorial, we learn about how to install laravel latest version in a simple example by anil Sidhu laravel Language

Points of Video is here
Laravel 7 install
need to install composer
need to install laravel installer
command to make project
run project

https://www.youtube.com/watch?v=p2PLgQVqS7g install composer

laravel 7 complete playlist link is here: https://www.youtube.com/playlist?list=PL8p2I9GklV46twRyl207h5LcsdjB9S9B0

facebook page link is here
https://www.facebook.com/stepbysteplearn/

react js in hindi: https://www.youtube.com/playlist?list=PL8p2I9GklV44oDSE3j-E-OkvxFkz5a1d8

Checkout and subscribe our new channel for technical news
https://www.youtube.com/channel/UCUu2FA5OO9KpFXL2ZYR0aNg

jnaghiloo 2020-03-17 11:54:56
Hi guys
There is an article to how make reset password api via SMS?!
jnaghiloo 2020-03-17 12:07:20
How can I guarantee the user that sends new password is exactly the same one that requested code?!
jnaghiloo 2020-03-17 13:21:36
Is this correct to check a cached activation code?

public function withValidator($validator)
{
if (!$validator->fails()) {
if(Cache::has($this->mobile))
{
if(Cache::get($this->mobile) != $this->code)
{
$validator->errors()->add(‘code’, ‘code is incorrect!’);
}else
{
$this->user = User::where(‘mobile’, $this->mobile)->first();
}
}else
{
$validator->errors()->add(‘code’, ‘code not found!’);
}
}
}

jnaghiloo 2020-03-17 13:22:45
because it is temp and I dont need to fill a field permanently
jnaghiloo 2020-03-17 13:24:34
but I do not know why it generates token even if the activation code entered incorrectly.
jnaghiloo 2020-03-17 13:25:49
what are the differences? because I am using database cache table
jnaghiloo 2020-03-17 13:27:26
no, I am beginner in laravel
jnaghiloo 2020-03-17 13:29:25
is this reset password table?
jnaghiloo 2020-03-17 13:31:21
now the problem is withvalidator function in the request does not validate that! I don’t know why!
jnaghiloo 2020-03-17 15:09:29
who knows what is the problem of my withValidator method
I am really confused!
I want to return an error if it fails

public function withValidator($validator)
{
if (!$validator->fails()) {
if(Cache::has($this->mobile))
{
if(Cache::get($this->mobile) != $this->code)
{
$validator->errors()->add(‘code’, ‘code is incorrect!’);
}else
{
$this->user = User::where(‘mobile’, $this->mobile)->first();
}
}else
{
$validator->errors()->add(‘code’, ‘code not found!’);
}
}
}

jnaghiloo 2020-03-17 15:32:47
I Solved that, if anyone need:

public function withValidator($validator)
{
if (!$validator->fails()) {
$validator->after(function ($validator) {
if (Cache::has($this->mobile)) {
if (Cache::get($this->mobile) != $this->code) {
$validator->errors()->add(‘code’, ‘code is incorrect!’);
} else {
$this->user = User::where(‘mobile’, $this->mobile)->first();
}
} else {
$validator->errors()->add(‘code’, ‘code not found!’);
}
});
}

DesolatorMagno 2020-03-17 17:01:52
There is not, you just use it if you need it, it will almost always be use if you don’t follow the standard names for tables.
AngelGoitia 2020-03-17 18:25:15
Have someone used Sengrid?
|