Monthly Archives: April 2018

Laravel: Reset Password From an API

Assalamualaikum, Today, will share about how to reset your account in Laravel application from an API. This is assumed you already setup JWT Auth in your Laravel app. Create a new API controller – php artisan make:controller Api/Auth/ForgotPasswordController and copy paste the following code, and add the forgot password route in routes/api.php. So, basically what… Read More »

Laravel: HasDatatable Trait

Assalamualaikum, Just a simple setup on datatable – to have a trait that can be use for other models. Assumed that you already install Yajra Datatable, we going to setup the API end point, simplify the setup of datatable. Here the trait: You can use the protected $datatable property to select which fields to display… Read More »

Laravel: Observer Setup Enhancement

Assalamualaikum, It’s been awhile since my last blog post. Today, just want to share something simple, an enhancement of LARAVEL: CREATE HASHED ID FOR A RESOURCE USING OBSERVER. Going to refactor a bit. First, let’s modify the app/Observers/Kernel.php, to be like the following: Next, add new config file for our observer – config/observers.php: And that’s… Read More »