PHP code example of xinningsu / laravel-raw-sql
1. Go to this page and download the library: Download xinningsu/laravel-raw-sql 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/ */
xinningsu / laravel-raw-sql example snippets
use Illuminate\Support\Facades\DB;
use App\Models\User;
echo DB::table('user')->where('id', 1)->where('verified', 1)->toSql();
// or
echo User::where('id', 1)->where('verified', 1)->toSql();
echo DB::table('user')->where('id', 1)->where('verified', 1)->toRawSql();
// or
echo User::where('id', 1)->where('verified', 1)->toRawSql();