This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class RedirectToLowercase | |
{ | |
/** | |
* Handle an incoming request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use Illuminate\Support\Str; | |
trait HasFilters | |
{ | |
public function scopeFilter($query, $filters = []) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Livewire\Component; | |
class Download extends Component | |
{ | |
public function download() | |
{ | |
// get the path to the file | |
$path = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function scopeSearch($query, $search) | |
{ | |
$search = addslashes($search); // in case the search has quotes | |
$query->when( | |
$search, | |
fn ($q) => $q->whereRaw( | |
"CONCAT_WS(' ', title, first_name, last_name, suffix) LIKE '{$search}%'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model as EloquentModel; | |
use Sushi\Sushi; | |
class StaticModel extends EloquentModel | |
{ | |
use Sushi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use App\StaticModel; | |
class Country extends StaticModel | |
{ | |
protected $schema = [ | |
'calling_code' => 'string', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use App\StaticModel; | |
class Region extends StaticModel | |
{ | |
protected $schema = [ | |
'id' => 'string', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | calling_code | capital_city | code_2 | code_3 | continent_id | currency_id | flag | name | |
---|---|---|---|---|---|---|---|---|---|
ad | 376 | Andorra la Vella | ad | and | eu | eur | 🇦🇩 | Andorra | |
ae | 971 | Abu Dhabi | ae | are | as | aed | 🇦🇪 | United Arab Emirates | |
af | 93 | Kabul | af | afg | as | afn | 🇦🇫 | Afghanistan | |
ag | 1268 | St. John's | ag | atg | na | xcd | 🇦🇬 | Antigua and Barbuda | |
ai | 1264 | The Valley | ai | aia | na | xcd | 🇦🇮 | Anguilla | |
al | 355 | Tirana | al | alb | eu | all | 🇦🇱 | Albania | |
am | 374 | Yerevan | am | arm | as | amd | 🇦🇲 | Armenia | |
ao | 244 | Luanda | ao | ago | af | aoa | 🇦🇴 | Angola | |
aq | 672 | aq | ata | an | 🇦🇶 | Antarctica |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | code | country_id | name | |
---|---|---|---|---|
ad-02 | ad-02 | ad | Canillo | |
ad-03 | ad-03 | ad | Encamp | |
ad-04 | ad-04 | ad | La Massana | |
ad-05 | ad-05 | ad | Ordino | |
ad-06 | ad-06 | ad | Sant Julia de Loria | |
ad-07 | ad-07 | ad | Andorra la Vella | |
ad-08 | ad-08 | ad | Escaldes-Engordany | |
ae-aj | ae-aj | ae | Ajman | |
ae-az | ae-az | ae | Abu Zaby |