Search
 
SCRIPT & CODE EXAMPLE
 

PHP

What is the method of querying from two tables with a condition in Laravel

$query = Invoice_Details::query()-> with('invoice');
          
        
         if($request->invoice_type==1){

              $query->whereRelation('invoice','Invoice_type','=' ,1);
           }

    $Details = $query->get();

    return $Details -> sum('quantity');
Comment

PREVIOUS NEXT
Code Example
Php :: Convert English Date Time To Persian Date Time JDF PHP 
Php :: was loaded over https, but requested an insecure xmlhttprequest endpoint laravel 
Php :: composer install error 
Php :: laravel post index method 
Php :: php header x-powered-by 
Php :: jsondecodephparray 
Php :: laravel route where not contain 
Php :: acf if image else display other image 
Php :: same name selection in phpstorm mac 
Php :: afficher les input dans un tableau php est stocker dans fichier 
Php :: PHP SimpleXML - Get Node/Attribute Values 
Php :: Replace default WP search and dropdown placeholder 
Php :: Add text below product title on archive page + ACF 
Php :: fuelphp authentication 
Php :: how to read laravel query string with dash 
Php :: Jaygaah Free Shipping Woocommerce 
Php :: validation sellphone laravel 
Php :: carbon parse 
Php :: symfony user online 
Php :: SSL certificate problem: certificate has expired php 
Php :: display PHP errors based on environment variable 
Php :: check which device is used to open webpage php 
Php :: change php platform of composer 
Php :: file viewer codeigniter 
Php :: wc php retrieve the order Id on Order pay page 
Php :: Jolt transform specification input 
Php :: laravel allow null records relationship 
Php :: laravel seeder with relationship 
Php :: laravel showing index of 
Php :: como leer archivos .env php 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =