Put SearchTrait.php
in app
directory. Then use SearchTrait in your model, like so
use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;
class Article extends Model {
/** | |
* @function whois | |
* @author Manojkiran | |
* @contact [email protected] | |
* @param string $domain | |
* @usage Displays the whois information form given domain Name | |
* @version 1.3 | |
**/ | |
/* | |
|-------------------------------------------------------------------------- |
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Support\Facades\Gate; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\Facades\Blade; | |
use App\Models\Permission; |
<?php | |
/** | |
* Dumps a given variable along with some additional data. | |
* | |
* @param mixed $var | |
* @param bool $pretty | |
*/ | |
function dd($var, $pretty = false) | |
{ |
<?php | |
// Examples for URL: https://example.com/subFolder/yourfile.php?var=blabla#12345 | |
//built-in function | |
$x = parse_url($url); | |
$x['scheme'] 🡺 https | |
$x['host'] 🡺 example.com (or with WWW) | |
$x['path'] 🡺 /subFolder/yourfile.php | |
$x['query'] 🡺 var=blabla | |
$x['fragment'] 🡺 12345 // hashtag outputed only in case, when hashtag-containing string was manually passed to function, otherwise PHP is unable to recognise hashtags in $_SERVER |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
<?php | |
// Usage: | |
// Before | |
@if ($errors->has('email')) | |
<span>{{ $errors->first('email') }}</span> | |
@endif | |
// After: |
desc: | |
In addition, if the current time is less than 30 minutes from endhour, expired is also counted as expired. | |
Array | |
( | |
[0] => Array | |
( | |
[date] => 2019-06-01 | |
[week] => Saturday | |
[subdate] => 06-01 |