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
| module.exports.generatePdf = async ()=>{ | |
| async function Html() { | |
| try { | |
| const data = { | |
| name: 'Faizan' | |
| } |
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
| https://myaccount.google.com/lesssecureapps | |
| https://accounts.google.com/b/0/DisplayUnlockCaptcha |
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 artisan make:migration alter_braintree_to_subscriptions --table=subscriptions | |
| php artisan make:migration add_stripe_id_to_users --table=users |
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
| // Generate unique IDs for use as pseudo-private/protected names. | |
| // Similar in concept to | |
| // <http://wiki.ecmascript.org/doku.php?id=strawman:names>. | |
| // | |
| // The goals of this function are twofold: | |
| // | |
| // * Provide a way to generate a string guaranteed to be unique when compared | |
| // to other strings generated by this function. | |
| // * Make the string complex enough that it is highly unlikely to be | |
| // accidentally duplicated by hand (this is key if you're using `ID` |
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 | |
| class TimeoutClass extends Thread { | |
| public function __construct(callable $cb, int $time, $args){ | |
| $this->callback = $cb; | |
| $this->args = $args; | |
| $this->time = $time * 1000; | |
| } | |
| public function run(){ | |
| usleep($this->time); |
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
| # 7.4 | |
| sudo apt-get -y install php-pear php7.4-dev | |
| sudo update-alternatives --set php /usr/bin/php7.4 | |
| sudo update-alternatives --set phar /usr/bin/phar7.4 | |
| sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4 | |
| sudo update-alternatives --set phpize /usr/bin/phpize7.4 | |
| sudo update-alternatives --set php-config /usr/bin/php-config7.4 | |
| sudo pecl uninstall -r sqlsrv |
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
| <template> | |
| <div class="widget"> | |
| <div v-if="activeItems && activeItems.length > 0"> | |
| <ul> | |
| <li v-for="item in activeItems" :key="item.id"> | |
| {{item.name}} | |
| </li> | |
| </ul> | |
| </div> | |
| </div> |
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 NewCustomerRequest 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
| This is the request validadtion code for post route | |
| https://gist.github.com/Faizanq/3d2b435b7c61fa37f28feb74ddef2daa | |
| Customer Controller Code | |
| https://gist.github.com/Faizanq/f7096495a66080e15c31d6ea55e98b7a | |
| Customer mail observer which is responsible for mail sending | |
| https://gist.github.com/Faizanq/60fd21b3f4c4ee71876fbe2429d5295d | |
| Customer model where we injecting observer for create event |
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\Controllers; | |
| use App\Models\Customer; | |
| use App\Http\Requests\NewCustomerRequest; | |
| class CustomerController extends Controller |