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\Contracts\BrandNameResolverInterface as BrandNameResolverServiceContract; | |
use App\Http\Controllers\Auth\PasswordBrokerManager; | |
use App\Repositories\Interfaces\AccountInterface; | |
use App\Services\Filesystem\FtpAdapter; | |
use App\Services\User\AccountSessionService; | |
use App\View\Components\Modal; |
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 | |
class CallArtisanWithOptions { | |
public function test_migrate_documents(): void | |
{ | |
$this->artisan('app:migrate-ftp-documents-to-local-storage') | |
->expectsChoice( | |
'Are you sure you want to migrate all documents from FTP to local storage?', | |
'yes', | |
['yes', 'no'] | |
)->expectsChoice( |
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 Illuminate\Support\Arr; | |
use Illuminate\Support\Facades\Log; | |
use ReflectionClass; | |
use ReflectionProperty; | |
trait FilterOnlyAvailable | |
{ | |
/** |
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 | |
// now raw() returns an expression which requires Grammar as argument, but we can provide grammar used for the current connection | |
DB::select(DB::raw("SELECT DISTINCT(company_size) FROM accounts WHERE company_size <> ''")->getValue(DB::getSchemaGrammar())); |
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\Mail; | |
use Illuminate\Mail\Mailable as MailableBase; | |
class Mailable extends MailableBase { | |
/** | |
* this returns the plain text view for the e-mail in tests |
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 | |
class BladeViewCorrectSyntaxTest { | |
/** | |
* @see https://stackoverflow.com/questions/38400305/phpunit-help-needed-about-risky-tests | |
*/ | |
public function view_test() | |
{ | |
$viewName = 'some.view'; |
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\Facades; | |
use App\Services\Common\NumberService; | |
use Illuminate\Support\Facades\Facade; | |
class NumberFacade extends Facade { | |
// here we fetch NumberService from the container |
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 | |
Schema::create('editable_fields', function (Blueprint $table) { | |
$table->increments('id'); | |
// instead of | |
// $table->string('key'); | |
// add an index to the referenced field | |
$table->string('key')->index(); | |
}); |
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 | |
return new class extends Migration | |
{ | |
/** | |
* Run the migrations. | |
*/ | |
public function up(): void | |
{ | |
Schema::create('field_settings', function (Blueprint $table) { |