What is wrong on the first code?

|
itsAxton 2022-08-24 22:16:31
i ran this on my laravel

$data = Vehicle::whereHas(‘group’,function($query){
$query->whereBetween(‘vehicles.capacity’,[‘min_capacity’,’max_capacity’]);
})->with(‘group’)-get()

and it show nothing

itsAxton 2022-08-24 22:17:03
but the same query is ran by this “`
select * from `vehicles` where exists (select * from `vehicle_groups` where `vehicles`.`category_id` = `vehicle_groups`.`category_id` and `vehicles`.`capacity` between min_capacity and max_capacity) and `company_id` = 1
“`

it gives me results,
what is wrong on the first code ?

FaKe_Sahandi81 2022-08-24 22:17:10
Tobel_l 2022-08-24 22:11:36
How to get the current month in laravel

date(‘m’) 😁😁

FaKe_Sahandi81 2022-08-24 22:18:45
itsAxton 2022-08-24 22:16:31
i ran this on my laravel

$data = Vehicle::whereHas(‘group’,function($query){
$query->whereBetween(‘vehicles.capacity’,[‘min_capacity’,’max_capacity’]);
})->with(‘group’)-get()

and it show nothing

Did U check deleted_at column ?

itsAxton 2022-08-24 22:19:08
i dont have that column
FaKe_Sahandi81 2022-08-24 22:20:18
itsAxton 2022-08-24 22:16:31
i ran this on my laravel

$data = Vehicle::whereHas(‘group’,function($query){
$query->whereBetween(‘vehicles.capacity’,[‘min_capacity’,’max_capacity’]);
})->with(‘group’)-get()

and it show nothing

Put ->dd() befor get method and check the query

itsAxton 2022-08-24 22:20:56
itsAxton 2022-08-24 22:17:03
but the same query is ran by this “`
select * from `vehicles` where exists (select * from `vehicle_groups` where `vehicles`.`category_id` = `vehicle_groups`.`category_id` and `vehicles`.`capacity` between min_capacity and max_capacity) and `company_id` = 1
“`

it gives me results,
what is wrong on the first code ?

this is the query it executes,
i knwo becaouse i used toSql()

Candra 2022-08-24 22:23:21
Who wants to teach me fullstack?
FaKe_Sahandi81 2022-08-24 22:29:04
itsAxton 2022-08-24 22:20:56
this is the query it executes,
i knwo becaouse i used toSql()

Oh😐

FaKe_Sahandi81 2022-08-24 22:30:13
Are u sure use same database? Or dump $data correcrtly ?
itsAxton 2022-08-24 22:32:54
yes
littlefish111 2022-08-24 22:49:04
SalvoDM91 2022-08-23 10:38:58
Hi guys, I just installed Laravel 9 (on windows with xampp) and I have 2 questions:
1. Every day, when I start, I need to lounch “npm run dev”?
2. I’m using xampp, I need in any case launch also “php artisan serve”?

1) no 2) yes, if you runinng the laravel server. If you running apache for exampke on linux the service can start automtically as soon your pc is booting up (no)

FaKe_Sahandi81 2022-08-24 22:52:46
itsAxton 2022-08-24 22:32:54
yes

Thats amazing.
Remove the conditions one by one to find out problem

itsAxton 2022-08-24 23:05:35
$data = Vehicle::whereHas(‘group’,function($query){
$query->whereRaw(‘vehicles.capacity >= vehicle_groups.min_capacity AND vehicles.capacity <= vehicle_groups.max_capacity’);
})->with(‘group’)->get();
changed to this and shows data, but it is returning many griups that dont meet the condition where on whereHas
itsAxton 2022-08-24 23:09:01
anyone ?
Sakil 2022-08-24 23:19:48
Hi guys.. how to use two different PHP version in windows.. i have installed 7.4 on my E drive and 8.1 on my D drive then start the 8.1 xampp server then if i check the PHP version through command line then it’s show me 7.4.
Bugekurland 2022-08-25 00:30:07
Sakil 2022-08-24 23:19:48
Hi guys.. how to use two different PHP version in windows.. i have installed 7.4 on my E drive and 8.1 on my D drive then start the 8.1 xampp server then if i check the PHP version through command line then it’s show me 7.4.

check your path on windows and include the 8.1 ver

kdr_tb 2022-08-25 01:02:26
Hi guys. I want to write my database datas to JSON file in Laravel but i can’t. How should I do that?
Laksida 2022-08-25 04:09:01
Can somebody help me
Laksida 2022-08-25 04:11:36
I wil build my first admin invoice system
Laksida 2022-08-25 04:11:47
Is there somebody who can help
baymax_star 2022-08-25 05:32:07
[FORHIRE] [REMOTE] [FULLTIME]
Hello, everyone.
I am a professional web/app engineer with 6+ years of experience in Javascript and PHP frameworks. I have already developed many web and app projects with React, Node, Vue, Angular and PHP, CI, Laravel, and Python.
I am familiar with Android/iOS app development using react native and ionic.
Also, I am an expert in web scrapping with Python and PHP, Node.js.
I have strong experience in developing blockchain projects including smart contract development and front-end development using Solidity, Web3.js, etc.

My main skills are following:

– Frontend:
React/Redux.js, Redux-Saga, Redux-Thunk, React-Bootstrap, Material-UI
Typescript, Next.js, Nuxt.js, Django, Golang
Vue.js/VueX, Vuetify
Angular 1-10
PSD to HTML && Figma to HTML && XD to HTML, Bootstrap 4, Tailwind CSS, LESS/SASS/SCSS, Responsive UI

– Backend:
PHP, CI, Laravel, Cake PHP
Node/Express.js
Python, Django

– Blockchain:
Developing NFT marketplace
Developing De-Fi apps like pancakeswap and uniswap
Token development (ERC20, ERC223, ERC721, ERC 1155)
Smart contract development, testing, and deployment (Solidity, Rust, Solana, Truffle framework)
Web3.js, Ethers.js
Ethereum & Binance smart chain(BSC), Avalanche, Polygon

– Mobile App:
Android, iOS
React Native, react native cli, expo cli
Ionic

– Web Scrapping:
Python/Selenium, Node.js, PHP

– Database:
SQL, MySQL, SQLite, MongoDB, MariaDB, PostgreSQL, NoSQL

I can work over 40+ hours per week and if you want more, I can work in full time without weekend rest. Also my communication is very quick so that I can reply your message in short time.
I hope I work with all clients in long term.
If you are looking for senior web and app developer, please contact me anytime.
I am always ready for you 🙂

Sakil 2022-08-25 07:00:39
Bugekurland 2022-08-25 00:30:07
check your path on windows and include the 8.1 ver

Ok but there is already 7.4 included. So is it possible to include 8.1 too and use it..

anujrock1 2022-08-25 07:12:28
Sakil 2022-08-24 23:19:48
Hi guys.. how to use two different PHP version in windows.. i have installed 7.4 on my E drive and 8.1 on my D drive then start the 8.1 xampp server then if i check the PHP version through command line then it’s show me 7.4.

Check what is being used in environment variable

anujrock1 2022-08-25 07:12:57
Of your system
Sakil 2022-08-25 07:28:11
anujrock1 2022-08-25 07:12:28
Check what is being used in environment variable

7.4 is being use in my system and i need 8.1 too

Anand Tujare 2022-08-25 07:57:31
Sakil 2022-08-24 23:19:48
Hi guys.. how to use two different PHP version in windows.. i have installed 7.4 on my E drive and 8.1 on my D drive then start the 8.1 xampp server then if i check the PHP version through command line then it’s show me 7.4.

U will need to update the environment variable from E drive to D drive whenever u want to switch between the two

Sakil 2022-08-25 07:58:12
Anand Tujare 2022-08-25 07:57:31
U will need to update the environment variable from E drive to D drive whenever u want to switch between the two

Okay

BritnessDev 2022-08-25 08:36:51
[FORHIRE] [REMOTE] [FULLTIME]
Hello, everyone.
I am a professional web/app engineer with 6+ years of experience in Javascript and PHP frameworks. I have already developed many web and app projects with React, Node, Vue, Angular and PHP, CI, Laravel, and Python.
I am familiar with Android/iOS app development using react native and ionic.
Also, I am an expert in web scrapping with Python and PHP, Node.js.
I have strong experience in developing blockchain projects including smart contract development and front-end development using Solidity, Web3.js, etc.

My main skills are following:

– Frontend:
React/Redux.js, Redux-Saga, Redux-Thunk, React-Bootstrap, Material-UI
Typescript, Next.js, Nuxt.js, Django, Golang
Vue.js/VueX, Vuetify
Angular 1-10
PSD to HTML && Figma to HTML && XD to HTML, Bootstrap 4, Tailwind CSS, LESS/SASS/SCSS, Responsive UI

– Backend:
PHP, CI, Laravel, Cake PHP
Node/Express.js
Python, Django

– Blockchain:
Developing NFT marketplace
Developing De-Fi apps like pancakeswap and uniswap
Token development (ERC20, ERC223, ERC721, ERC 1155)
Smart contract development, testing, and deployment (Solidity, Rust, Solana, Truffle framework)
Web3.js, Ethers.js
Ethereum & Binance smart chain(BSC), Avalanche, Polygon

– Mobile App:
Android, iOS
React Native, react native cli, expo cli
Ionic

– Web Scrapping:
Python/Selenium, Node.js, PHP

– Database:
SQL, MySQL, SQLite, MongoDB, MariaDB, PostgreSQL, NoSQL

I can work over 40+ hours per week and if you want more, I can work in full time without weekend rest. Also my communication is very quick so that I can reply your message in short time.
I hope I work with all clients in long term.
If you are looking for senior web and app developer, please contact me anytime.
I am always ready for you

Neophyte_01 2022-08-25 08:38:00
I want to add captcha image which is mixture of characters and numbers in laravel 9. Which package should I use ? I tried mews/captcha it’s not working
BritnessDev 2022-08-25 08:40:49
Please use anhskohbo/no-captcha
BritnessDev 2022-08-25 08:41:15
composer require anhskohbo/no-captcha
BritnessDev 2022-08-25 08:41:27
Please see https://www.codecheef.org/article/laravel-9-google-recaptcha-tutorial-example
itspirate 2022-08-25 08:58:05
Guys I need some idea…..

I Have frontend in react and backend in Laravel
I want that user can request a data processing which is lengthy so I want to give the user relaxation when the data is processing in background user can visit anyother place in the application and notify user with toaster when data processing is end and ready to show ….

How it could be possible which topic I have to read in the docs suggest any blog or tutorial

Mohammed Hassanein 2022-08-25 09:00:29
Hi,how can I export pdf with Qr code AND BARCODE from laravel …is there any example ….need help .
|