I use Spatie’s excellent laravel-permission package in a Laravel 5.7 application to create permissions, assign them to roles, and assign roles to users. I frequently want to check whether an authenticated user has a specific permission. The package includes Blade directives such as @hasrole and @can that can be used in views, but there isn’t a standard for checking a user’s permission within a Vue component. Passing props to each component can become tiresome and inconsistent. What if there was a better way?
The below, inspired by an older post from Sergi Tur Badenas, describes a pattern that can be used in Vue components that are used by a Laravel application to check whether an authenticated user has a specified permission. It should be easy to adjust accordingly for different ACL packages.
Have you ever wanted to expose a local server behind a NAT or firewall to the internet? This can be useful when developing
webhooks that require a public address. It can also be useful if you want to demo or get feedback on in-progress work that is on your
local development environment without a deployment. I recently used ngrok to allow a product manager to try in-progress
work that was hosted on my local Laravel Homestead environment. After getting past one gotcha that wasn’t immediately obvious to me, it
In my last post, I reminisced about my bbs software that I wrote and sold in 1993. In 1995, I
was a senior in high school, and my school had just purchased a 76 computer Novell network for the 900 students to use. Nobody in the
school’s staff had a background in maintaining computers or a network, but this was a state of the art system that they had bought,
so surely it would keep purring without a hiccup. Right?
The buzz around Mastodon’s federated social network has made me nostalgic about bulletin board
systems in the early nineties. It was an era that is unknown to most people. It was social networking before the phrase existed, and before
giant corporations owned the social networks. Bulletin Board Systems had message boards, private messages, file sharing, and many of the
social features that we are accustomed to in modern web and mobile applications.