- create droplet and choose root password
- login to server using the ssh password
ssh root@ip - upgrade os packages
apt updateapt list --upgradableapt upgrade
- add new user
adduser 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
| name: Deploy Laravel Application to Production Server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest |
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 App\Enums\Types\ActivityType; | |
| use App\Models\Activity; | |
| use Illuminate\Database\Eloquent\Relations\MorphMany; | |
| use Illuminate\Database\Eloquent\Relations\MorphOne; | |
| trait HasActivities |
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 | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Sharing Laravel's session and checking authentication | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Use the following code in any CMS (WordPress, Joomla, etc), filemanager (CKFinder, | |
| | KCFinder, simogeos's Filemanager, etc), or any other non-Laravel project to boot into | |
| | the Laravel framework, with session support, and check if the user is authenticated. |
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\Http\Requests; | |
| use Illuminate\Foundation\Http\FormRequest; | |
| class CustomValidationRequest extends FormRequest | |
| { | |
| /** | |
| * Determine if the user is authorized to make this request. |
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\Models\Location; | |
| use App\Models\LocationCategory; | |
| /** | |
| * ------------------------------------------------------------------------- | |
| * Get location categories | |
| * ------------------------------------------------------------------------- | |
| */ |