$searchable = [
'type',
'date',
];
$petsQuery = Pet::where('user_id', '=', $request->user()->id);
// OR: $petsQuery = Pet::query(). For empty query
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\Foundation\Http\FormRequest; | |
use Illuminate\Validation\Rules\Unique; | |
class RegisterRequest extends FormRequest | |
{ | |
const NAME_MAX_LENGTH = 255; | |
const EMAIL_MAX_LENGTH = 255; | |
const PASSWORD_MIN_LENGTH = 8; |
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\Models; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Illuminate\Support\Facades\Hash; | |
class User extends Authenticatable | |
{ |
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
# Create and insert data | |
CREATE TABLE `datetime_timestamp` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`datetime_value` datetime NOT NULL, | |
`timestamp_value` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`inputted_timezone` varchar(255) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
SET @@time_zone = 'SYSTEM'; |
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
Show hidden characters
{ | |
"Insert namespace": { | |
"prefix": "name", | |
"body": ["namespace $1${TM_DIRECTORY/[\\/]/\\\\/g};", "$2"] | |
}, | |
"Construct": { | |
"prefix": "cons", | |
"body": ["${1:public} function __construct()", "{$2\n}$0"] | |
}, | |
"Class": { |
A VPS is just a server machine (Ubuntu, CentOS,...) on the Internet which you can SSH into.
A local VPS is a VPS but running on your local machine thanks to Virtual Machine technology. It's very simple to create a VM thanks to Vagrant, so that you can use it to play with SSH, test deployment, test Ansible playbook,...
- Install VirtualBox
- Install Vagrant
- Create a virtual machine, for example: Ubuntu 20.04
OlderNewer