- Spin up a new App server, choose PHP 8
- SSH into it and run
sudo -ito become root - Run
pecl install swooleand enable what you need. (I disabled curl as it did not work for me) - Add a new Site to your server and use git to pull in your Laravel project that has Octane installed.
- Point your DNS to your new site
- Enable SSL using Lets Encrypt
- Change your new Sites Nginx settings to (assuing your site is named octane.example.com):
| <?php | |
| declare(strict_types=1); | |
| namespace App\DataTransferObjects; | |
| use Carbon\CarbonImmutable; | |
| use Spatie\DataTransferObject\Caster; | |
| class CarbonImmutableCaster implements Caster |
- Adopted from: https://stubby4j.com/docs/admin_portal.html
- Inspired by Swagger API docs style & structure: https://petstore.swagger.io/#/pet
| <?php | |
| use Illuminate\Database\Eloquent\Builder; | |
| Builder::macro('toSqlWithBindings', function () { | |
| $bindings = array_map( | |
| fn ($value) => is_numeric($value) ? $value : "'{$value}'", | |
| $this->getBindings() | |
| ); |
| # Replace! | |
| # [!server!] (the forge server instance) | |
| # [!sudo_password!] (random password for sudo) | |
| # [!db_password!] (random password for database user) | |
| # [!user.name!] (git user name) | |
| # [!user.email!] (git user email) | |
| # [!server_ip!] (git user email) | |
| # | |
| # REQUIRES: |
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Request; | |
| class JsonMiddleware | |
| { | |
| public function handle(Request $request, Closure $next) |
This is a compiled list of Laravel interview questions. If Laravel is an engineer's PHP framework of choice, they definitely have potential to be a good candidate, but a lot of new PHP engineers have been into Laravel too. The framework itself is very welcoming to newcomers, which makes it easy for beginners to feel that they know more than they really do.
1. How long have you been using Laravel?
This question can help decide what level of questions to ask.
| <?php | |
| /** | |
| * A helper file for Laravel 5, to provide autocomplete information to your IDE | |
| * Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18. | |
| * | |
| * @author Barry vd. Heuvel <barryvdh@gmail.com> | |
| * @see https://github.com/barryvdh/laravel-ide-helper | |
| */ | |
| namespace { |
| <?php | |
| use Silex\Application; | |
| use Silex\ServiceProviderInterface; | |
| use Illuminate\Database\Capsule\Manager as Capsule; | |
| use Illuminate\Events\Dispatcher; | |
| use Illuminate\Container\Container; | |
| use Illuminate\Cache\CacheManager; | |
| class CapsuleServiceProvider implements ServiceProviderInterface | |
| { |