This file contains hidden or 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 App\Http\Controllers\Controller; | |
| // choose one of these following Response class, or use Response Facade \ alias | |
| // use Symfony\Component\HttpFoundation\Response; | |
| // use Illuminate\Http\Response; | |
| // use Illuminate\Support\Facades\Response; | |
| class BetterResponseStatus extends Controller |
This file contains hidden or 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
| //app/helpers.php | |
| if (! function_exists('foo_bar')) { | |
| function foo_bar($acme) | |
| { | |
| // | |
| } | |
| } | |
| //composer.json |
This file contains hidden or 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
| $controller = app()->make('App\Http\Controllers\MyController'); | |
| app()->call([$controller, 'myMethodName'], []); |
This file contains hidden or 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
| /** | |
| * Get the login username to be used by the controller. | |
| * | |
| * @return string | |
| */ | |
| public function username() | |
| { | |
| $login = request()->input('username'); | |
| $field = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'username'; |
This file contains hidden or 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 Uuid | |
| { | |
| /** | |
| * The "booted" method of the model. |