PHP code example of joelharkes / laravel-model-joins

1. Go to this page and download the library: Download joelharkes/laravel-model-joins library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

joelharkes / laravel-model-joins example snippets


User::query()->joinMany(Transaction::class);

User::query()->joinMany(Transaction::class);
$post->user()->joinMany(Transaction::query()->withoutTrashed());
Transaction::query()->joinOne(User::class, type: 'left');
Transaction::query()->joinOne(User::query()->where('is_manager', true));

User::query()->joinMany(Transaction::class);

Transaction::query()->joinOne(User::class);

Transaction::query()
    ->joinOne(User::query()->where('is_manager', true));