Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Pineco.de:
Notify Locked Out Users in Laravel
Jan 07, 2019 @ 19:17:27

On the Pineco.de blog they've posted a tutorial for the Laravel users out there showing how to notify locked out users making use of functionality already included with the framework.

Laravel offers a nice feature, that locks out the users that attempted to login too much. It’s a nice way to prevent brute force logins. But how can we notify the user, when the lockout happens? Maybe it wasn’t the user who attempted to log in.

The tutorial starts with the details on setting up the listener to capture the Lockout event and pass it off to a UserLockedOut class. Once this is created, they show how to use this class and, via the included "notification" system in Laravel, send an email to the user in question with more information about their account being locked.

tagged: laravel tutorial user lockout notification

Link: https://pineco.de/notify-locked-out-users-in-laravel/

TutsPlus.com:
Notifications in Laravel
Apr 24, 2018 @ 18:25:24

On the TutsPlus.com site they've posted a new tutorial for the Laravel users out there showing how to work with notifications, a feature build into the framework to make it simpler to provide information to users when certain events are triggered.

In this article, we're going to explore the notification system in the Laravel web framework. The notification system in Laravel allows you to send notifications to users over different channels. Today, we'll discuss how you can send notifications over the mail channel.

The tutorial starts with some of the basics of the notification system including a mention of the other methods (like SMS and Slack) and storing them in a database for other interaction. It then moves on to the creation of a Messages model and a custom notification class to send email to a when a new message is sent from another user. With the class created, they move into the process required to send the notification using the Notification::send method.

tagged: laravel tutorial notification email custom message

Link: https://code.tutsplus.com/tutorials/notifications-in-laravel--cms-30499

Herberto Graca:
Event-Driven Architecture
Oct 10, 2017 @ 15:28:19

In this new post to his site Herberto Graca has posted the latest part of his "The Software Architecture Chronicles* series, focusing this time on event-driven architectures.

This post is part of The Software Architecture Chronicles, a series of posts about Software Architecture. In them, I write about what I’ve learned on Software Architecture, how I think of it, and how I use that knowledge. The contents of this post might make more sense if you read the previous posts in this series.

Using events to design applications is a practice that seems to be around since the late 1980s. We can use events anywhere in the frontend or backend. When a button is pressed, when some data changes or some backend action is performed.

But what is it exactly? When should we use it and how? What are the downsides?

He starts by talking about the "what", "when" and "why" of using events to drive the architecture of the system, going into each of the topics in a bit more depth:

  • To decouple components
  • To perform async tasks
  • To keep track of state changes (audit log)

He then goes on to talk about common patterns for event-driven applications including event notification, event-carried state transfer and event sourcing.

tagged: event architecture software decouple async state notification sourcing

Link: https://herbertograca.com/2017/10/05/event-driven-architecture/

SitePoint PHP Blog:
How to Add Real-Time Notifications to Laravel with Pusher
Jul 28, 2017 @ 14:21:37

The SitePoint PHP blog has posted a new tutorial showing you how you can add real-time notifications to a Laravel application with the help of the Pusher service.

The modern web user expects to be informed of everything that happens within the application. You don’t want to be that one website that doesn’t even have the notifications dropdown found not just in all social media websites, but everywhere else these days, too.

Luckily, with Laravel and Pusher, implementing this functionality is a breeze. The code we’ll write in this tutorial can be found here.

Pusher makes use of Websockets to relay messages back out to waiting clients, sending a push notification (hence the name of the service) rather than waiting for it to poll them for the latest updates. The tutorial starts off by creating a new Laravel installation based on a "blog" example. It then creates the "followers" migration and model and builds out the relationships between it and the user handling. From there they show how to create the routes for following/unfollowing users, the code to perform the action and how to use Laravel's own notifications functionality to integrate with the queue. With that in place they include code to show the current messages (last five) and output the Javascript required to push the messages out to waiting clients.

tagged: tutorial realtime notification laravel pusher websocket

Link: https://www.sitepoint.com/add-real-time-notifications-laravel-pusher/

CloudWays Blog:
Laravel Notification System On Slack And Email
Jul 27, 2017 @ 20:49:59

On the Cloudways blog Saquib Rizwan has continued the series showing how to use Laravel to build out an application the performs various kinds of notifications. In this latest article Saquib

In my previous articles, I helped you create a Laravel email sending system and a Contact Us form.

In this article, I will highlight another amazing feature of Laravel through a very basic Laravel notification system. Using this system, I will send a notification to the user by sending them an email and integrate Slack to setup the system for sending notifications on a Slack channel.

They start with setting up a new Laravel application, creating a "users" table and setting up the database. These instructions are for the Cloudways service but they give you an idea of what needs to be set up at least. Next is the code to set up the User model and to create a new notification for a "visit" to the page. First up is the email notification then comes the Slack notifications. Both use built-in functionality with the "Notifications" package in the framework to make the sending work.

tagged: tutorial laravel notification email slack introduction

Link: https://www.cloudways.com/blog/laravel-notification-system-on-slack-and-email/

SitePoint PHP Blog:
Real-Time Laravel Notifications and Follows? Sure, with Stream!
Apr 13, 2017 @ 18:07:43

The SitePoint PHP blog has a new tutorial posted from Christopher Pitt showing you how to set up real-time notifications and Follows with Stream in a Laravel application. Stream is a service that helps to take some of the burden out of creating "scalable newsfeeds and activity streams" with just a bit of extra code.

With Laravel, it’s pretty easy to create newsfeed sites, blogs, or even forums where people post content, comment, or even mark some of these posts as favorite. To spice things up, we can make the app more lively by adding notifications for actions performed by other users. In this tutorial, we’ll be relying on a service called Stream to add this functionality to our app.

Using this repository as a starting point how shows how to create a simple blog with some real-time features along with the usual CRUD operations on the blog posts themselves. He starts off by walking through the setup of the project in a Homestead Improved environment. Then it's on to the functionality:

  • setting up the user "follow" model and migration
  • creating the routes for the follow functionality
  • building out the controller and view templates

With that basic structure in place he then brings in the Stream functionality via the get-stream/stream-laravel package. He shows how to set up an application on the Stream site, configure the connection and add in the functionality to send notifications when posts are created.

tagged: tutorial realtime laravel notification follow getstream service

Link: https://www.sitepoint.com/real-time-laravel-notifications-follows-sure-stream/

TutsPlus.com:
Building Your Startup: Preparing for Text Messaging
Jan 23, 2017 @ 15:44:52

The TutsPlus.com site has posted the latest in their (lengthy) series of tutorials showing how to use PHP to "build your startup". In this new tutorial they show how to integrate SMS functionality into the application. This is the first part covering this topic and mostly covers the setup and testing of the connection to send the necessary SMS messages.

In today's episode, I'm going to walk you through the first half of my SMS configuration for the Meeting Planner application. Basically, I'll cover choosing an SMS provider, setting up the account, building the initial application infrastructure, and trial texting.

In the next episode, I'll build specific texting scenarios into the Meeting Planner application and walk you through those decisions and the coding that followed.

He starts off talking about one of the main choices you'll have to make early on: which SMS provider you want to use to send your messages. While they list several, for the sake of the tutorial they move ahead with Twilio. He show you how to set up an account with the Twilio service and where to get the credentials to connect your application to their API. After talking a bit about things like SMS pricing and handling incoming messages he starts on the integration with Yii2 via this package. Once installed and configured he creates a simple class to send a message via Twilio and tries it out with a "First test" message.

tagged: startup build tutorial series yii2 framework twilio sms notification

Link: https://code.tutsplus.com/tutorials/building-your-startup-preparing-for-text-messaging--cms-26912

Matt Stauffer:
The new Notification system in Laravel 5.3
Oct 20, 2016 @ 14:32:44

In the latest part of his series covering Laravel 5.3, Matt Stauffer has posted this new tutorial covering the new notification system in the latest version of the popular Laravel framework.

In a previous blog post I've covered Laravel's new Mailable feature, which introduces some important changes to how we send mail in Laravel. I'd recommend at least skimming it if you haven't read it yet. In short, the preferred mail syntax is no longer sending mail using the "classic" mail closures, but instead creating a "Mailable" class for each message you want to send—for example, the "WelcomeNewUser" mailable class.

In Laravel 5.3, we have another new feature for communicating with our users: Notifications.

This notification system makes it simpler to send messages to your user when you don't care as much how they get it, just that they do. He walks you through the creation of your first notification class and breaks it down into its main parts, explaining each one. He shows how to define the different handlers for the notification types (like "toEmail") and how to trigger the notification, passing in either a single user or all users in the system. He then talks about the channels that are available to notifications and how to integrate several including Nexmo, database and the "broadcast" channel.

tagged: laravel notification system tutorial introduction channel trigger

Link: https://mattstauffer.co/blog/the-new-notification-system-in-laravel-5-3

Laravel News:
New Community Project: Laravel Notification Channels
Aug 15, 2016 @ 15:53:13

On the Laravel News site there's a new post talking about a new community effort that's been started in the Laravel ecosystem centering around notification channels. A "notification channel" is a method used to interact directly with your users - in this case using Pusher notifications via a simplified interface.

Laravel 5.3 will ship with a notification system that includes a Nexmo SMS driver, a Mail driver, and the ability to include custom drivers. Now that we have this system built-in we can use the new Pusher service from inside our Laravel applications.

All we need to do is to create a custom driver and that’s it, we’ll be able to send Push notifications to our Mobile devices right away. With the help of Freek Van der Herten and Marcel Pociot we managed to build an easy to use driver for Pusher Push Notifications.

The Pusher system not only allows sending messages to you users via the web but also push notifications to mobile devices (iOS and Android). A simple code snippet is included showing the Laravel-centric interface to the functionality and a link to more code examples on a GitHub repository. The post ends with a brief section about creating customer drivers as well.

tagged: laravel community project notification channel pusher ios android

Link: https://laravel-news.com/2016/08/new-community-project-laravel-notification-channels/

SitePoint PHP Blog:
PHP, Arduino And… Minecraft? Combining Minecraft with PHP!
Jul 07, 2016 @ 18:35:15

On the SitePoint PHP blog author Christopher Pitt has a new tutorial posted about combining PHP, Arduino and Minecraft and combine the physical and software worlds in an interesting IoT combination.

Some of the most interesting programming I’ve done has been in Minecraft. It’s an open-world, sandbox game developed by Mojang, (recently acquired by Microsoft). Minecraft began as a canvas for creative expression, and while I do very different things in it these days, it still is that for me.

I’m going to take you on a journey, as we build a Minecraft mansion, and then secure it with a real-world alarm system. There’s quite a bit of ground to cover, and though I plan for this to be a two-part series, I’m going to have to leave some of the tangential details for you to discover!

For those not familiar with "programming" in Minecraft (not the backend language, but using things like redstone) he gives a brief introduction. He then sets up the situation - the creation of a "sprawling mansion" in your Minecraft world and a need to secure the front door. He includes the command to set up the "door open" test on a command block. He then shows how to hook this into a loop to continuously test if a door is open or not. With this open/closed door check system in place he then brings PHP into the mix, having it check log files for the "whispers" when the door actions happen. He then creates a watcher for these events and has it respond with a chat message back to the user. That's all in this tutorial but a future part of the series will add on the physical aspect - the Arduino.

tagged: tutorial physical arduino minecraft notification watcher series part1

Link: https://www.sitepoint.com/php-arduino-and-minecraft-combining-minecraft-with-php/


Trending Topics: