How to take column from two table in whereExists clause in laravel 5.5

87
January 25, 2021, at 11:10 PM

I have three table 1)allcasefileofuserrequest 2)allscanfileofuserrequest 3)userrequestforcasecopies

a) userrequestforcasecopies->allcasefileofuserrequest has one to many relationship

b) userrequestforcasecopies->allscanfileofuserrequest has one to many relationship c)id(primary key) in userrequestforcasecopies -> request_id(foreign key) in allcasefileofuserrequest

d)id(primary key) in userrequestforcasecopies -> request_id(foreign key) in allscanfileofuserrequest

I want to write sql query such that in where exist clause get record from allcasefileofuserrequest and allscanfileofuserrequest where approved_status is 1.Below Is my query in laravel 5.5

DB::table('userrequestforcasecopies')
                                                               
 ->where('id',$requestId)
                                                         
 ->where('first_approved_status',2)
                                                               
 ->whereExists(function($query) use($requestId)
                                                                            
 {
                                                                                
  $query->from('allcasefileofuserrequest')
                                                                                       
  ->fullJoin('allscanfileofuserrequest')
                                                                                        
  ->where('request_id', $requestId)
                                                                                        
  ->where('approved_status',1)
                                                                                        
  ->select('request_id')
                                                                                        
  ->get();
                                                                                
  })
                                                                             
                                                                
 ->update(['second_approved_status'=> 1,
                                                                        
 'second_approved_status_done_at' => Carbon::now()->format('Y-m-d H:i:s'),
                                                                        
 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')
                                                                            
 ]);

But full join not work on laravel 5.5

READ ALSO
Recursive select does not return date list [closed]

Recursive select does not return date list [closed]

Want to improve this question? Add details and clarify the problem by editing this post

101
Cannot publish new release to Google Play because of Sensitive app permissions

Cannot publish new release to Google Play because of Sensitive app permissions

The problem I'm facing is that I cannot create any new releases on any of the Google Play release tracks (internal, alpha, beta, production) since one of the old releases required location permissons

74
Convert datatime column to 18-digit LDAP timestamp

Convert datatime column to 18-digit LDAP timestamp

I have a csv file with AD users and their accountExpires attributeThe accountExpires values are currently in human readable format, but I want to convert it into 18-digit LDAP format so that I can import the file to change the date

94
cant get data from form to server - MERN

cant get data from form to server - MERN

im new and i cant get data from the form in server to insert it in the DB, heres the code:

101