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\Console\Commands; | |
use Illuminate\Console\Command; | |
class LaravelInstallCommand extends Command | |
{ | |
/** | |
* Execute the console command. |
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 | |
declare(strict_types=1); | |
/** | |
* This file is part of Laravel Console Task. | |
* | |
* (c) Nuno Maduro <enunomaduro@gmail.com> | |
* | |
* For the full copyright and license information, please view the LICENSE |
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\Commands; | |
use Illuminate\Console\Scheduling\Schedule; | |
use LaravelZero\Framework\Commands\Command; | |
use Illuminate\Support\Facades\Storage; | |
class BackupCommand extends Command | |
{ |
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
{ | |
"chmod": "0755", | |
"directories": [ | |
"app", | |
"bootstrap", | |
"config", | |
"vendor" | |
], | |
"files": [ | |
"composer.json" |
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\Search; | |
use Algolia\ScoutExtended\Searchable\Aggregator; | |
class News extends Aggregator | |
{ | |
/** | |
* The names of the models that should be aggregated. |
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\Providers; | |
use App\Search\News; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** |
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 | |
$models = App\Search\News::search('Star Trek')->get(); | |
echo get_class($models[0]); // "App\Article" | |
echo get_class($models[1]); // "App\Comment" | |
$results = App\Search\News::search('Star Trek')->raw(); | |
/* | |
{ | |
"hits":[ |
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 | |
$articles = Article::search('Star Trek')->where('views', '>', 100)->get(); | |
$articles = Article::search('Star Trek')->where('created_at', '>=', now()->subDays(7))->get(); | |
$articles = Article::search('Star Trek')->where('views', 100)->get(); // views = 100 |
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 | |
$products = Products::search('Star Trek') | |
->whereBetween('price', [100, 200]) | |
->get(); |
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 | |
$articles = Article::search('query') | |
->aroundLatLng(48.8588536, 2.3125377) | |
->get(); |
OlderNewer