Browsed by
Category: Laravel

Laravel: Activation Account by E-mail – Part 1

Laravel: Activation Account by E-mail – Part 1

From previous post, we extend the usage of Notifications, Event and Listener to have a mechanism where user need to activate their account in order to use the application. In this Part 1, we just setup the Notification, Event and Listener. Part 2 will be about how do we check if user already activate their account or not.

Laravel: Create Welcome Email

Laravel: Create Welcome Email

A quick post on how to setup a welcome email on user registration. Make sure you have a mailtrap.io account for testing purpose, or production you may use SparkPost, or GMail SMTP, or any provider should work with proper .env on mail configuration.

Laravel: Billplz Helper

Laravel: Billplz Helper

Billplz is a simple cash solution to send bills and collect payments in real-time. There’s already a package available for PHP. We going to create a wrapper and helper for Laravel application for the Billplz. First, create a config file for Billplz – config/billplz.php Then create a utility class in app/Utilities directory: Lastly, create a helper in app/Support directory named helpers.php, and add the following command. Now you’re done setting up your Billplz helper. You just need to setup BILLPLZ_API_KEY…

Read More Read More

Laravel: Package Generator

Laravel: Package Generator

Assalamualaikum / Hi, It’s been a long time, I wan to update my Laravel Package Generator and now it’s officially updated with version 2.0.2. Lots of experience, study case, observation, setting up things in Laravel package. Now I believe, it’s ready to speed up your Laravel Package Development. So, what the Packager do? Basically it creates a basic skeleton of Laravel package which consist of: Service Provider Facade README – with Installation instruction, License Term ready! Other details you need…

Read More Read More

Laravel: Blueprint Macro

Laravel: Blueprint Macro

Next, the thing that I want to share is how I create Blueprint Macro. Similar to my previous posts on Response and Route. But this time, we going to add more functionality to Blueprint which used in migrations. Update your user migration file: Now your code will be much cleaner. Feel free to fork and contribute to Blueprint Macro.

Laravel: Route Macro

Laravel: Route Macro

Here I want to show, how to extend existing route – get, post, etc. for your application. I’m going to create a new route Route::setting(‘module’), which will create all necessary route setup. Now register this new macro in your AppServiceProvider, in register() method. Then, you can start use the new route. To use this new route, you need a controller. So run php artisan make:controller Settings/ApplicationSettingController -r Then you may add in routes/web.php to register a new route setting. In…

Read More Read More

Laravel: Response Macro

Laravel: Response Macro

It’s quite straightforward to extend a class functionality with Macro. This time I show how to extend the Response class in Laravel. Create a class in app/Macros/Http called Response.php and add the content as following: Then register the Macro in AppServiceProvider Now you may test your new responses:

Laravel: Create Hashed ID for A Resource Using Observer

Laravel: Create Hashed ID for A Resource Using Observer

Install hashids/hashsids package Create a wrapper for hashids Create a helper for hashids Create a config file for hashids Create a migration, which add a hashslug field Create a helper to get slug name of the given class name (optional) Create an observer for hashids which monitor on creating new record – if there’s a hashslug column and it’s null, do create hashed id for the record. Register the observer to model in boot() method in your app/Providers/AppServiceProvider.php Now let’s…

Read More Read More

Migrate from WordPress to Laravel – Part 1

Migrate from WordPress to Laravel – Part 1

Assalamualaikum / Hi, I’ve been using WordPress, since 2012 – 5 years, of service. I think it’s time to migrate to another platform – Laravel. I’ve been reading how murze.be did. Basically, I got the idea how he did. But, as my sense of explorer, want to learn something new, I read few more articles, packages available out there for migrate from WordPress to Laravel. I ended up with my own solution. The idea – use the WordPress REST API….

Read More Read More