1. Go to this page and download the library: Download fatihirday/eloquent 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/ */
Model::caseWhen([
'updated_at > created_at' => 'updated_at', // When Then
'deleted_at > created_at' => 'deleted_at', // When Then
'created_at', // Else
], 'responseName')
use Fatihirday\Eloquent\Libraries\Enums\Like;
Model::whereLike('columnName', 'value', Like::FIRST);
// WHERE columnName like '%value'
Model::whereLike('columnName', 'value', Like::MIDDLE);
// WHERE columnName like '%value%'
Model::whereLike('columnName', 'value', Like::LAST);
// WHERE columnName like 'value%'
use Fatihirday\Eloquent\Libraries\Enums\Like;
Model::where('id', '>', 1)->orWhereLike('columnName', 'value', Like::FIRST);
// WHERE id > 1 or columnName like '%value'
Model::where('id', '>', 1)->orWhereLike('columnName', 'value', Like::MIDDLE);
// WHERE id > 1 or columnName like '%value%'
Model::where('id', '>', 1)->orWhereLike('columnName', 'value', Like::LAST);
// WHERE id > 1 or columnName like 'value%'
echo Model::where('name', 'value')->getSql();
// select * from `table_name` where `name` = 'fatih'
Model::where('name', 'value')->dumpSql();
// select * from `table_name` where `name` = 'fatih'
Model::where('name', 'value')->ddSql();
// select * from `table_name` where `name` = 'fatih'
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.