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\Services; | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Exception\ClientException; | |
/** | |
* Class FirebaseService | |
* @package App\Services | |
*/ | |
class FirebaseService |
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
#!/bin/bash | |
# SSH | |
ID_RSA=~/.ssh/id_rsa | |
USER=root | |
DOMAIN=my-domain.com | |
# Remote mysql | |
REMOTE_DB_USER=root | |
REMOTE_DB_PASS=database-password |
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
1) If sendmail isn't installed, install it: apt-get install sendmail | |
2) Configure hosts file correctly: nano /etc/hosts | |
Looked like: | |
127.0.1.1 myhostname myhostname | |
127.0.0.1 localhost | |
3) $ sudo sendmailconfig | |
4) test | |
$echo "Subject: sendmail test" | sendmail -v [email protected] |
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
chown www-data:www-data -R * # Let Apache be owner | |
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x | |
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r-- |
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
created: function () { | |
window.addEventListener('keyup', (event)=> { | |
if (event.keyCode === 27) { | |
this.showEditor = false; | |
} | |
}); | |
}, |
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\Admin; | |
use Illuminate\Foundation\Http\FormRequest; | |
class UpdateBoosterFormRequest extends FormRequest | |
{ | |
protected $errorBag = 'edit'; | |
/** | |
* 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
class TheAttribute | |
{ | |
public function __get($name) | |
{ | |
$name = array_map('ucfirst', explode('_', $name)); | |
$name = implode($name); | |
# use echo instead return if is not a framework | |
return $this->{'get' . $name . 'Attribute'}(); | |
} |
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
# ssh into the server | |
# go to the laravel project | |
$ php artisan tinker | |
# Example 1 , from view | |
$ Mail::send('errors.401',[],function($message){$message->to('[email protected]')->subject('this works!');}); | |
# Example 2, plain text | |
Mail::raw('Hi Mail Service',function($message){$message->to('[email protected]')->subject('this works!');}); |
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
# SSH into droplet | |
# go to project | |
$ php artisan tinker | |
$ Mail::send('errors.401', [], function ($message) { $message->to('[email protected]')->subject('this works!'); }); | |
# check your mailbox |
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
ir a https://console.developers.google.com/project/_/apiui/apis/library | |
crear credenciales > ID de Cliente OAUTH | |
Origines de JS autorizados = http://domain.com | |
URL de redireccionamiento autorizados = http://domain.com/g-callback | |
Copiar credenciales en .env de laravel |