- 61
- 77 698
James McDonald
Australia
เข้าร่วมเมื่อ 1 ส.ค. 2017
Information Technology Tips and developing with the CakePHP framework
CakePHP 5 - Dependency Injection using the Registry Pattern
This is video is based on a blog post at rizqi.id/laravel-registry-pattern
It shows how to register multiple different classes into the Dependency Injection container using the Registry Pattern and then select them at run time
Code: github.com/toggenation/di-registry-pattern
It shows how to register multiple different classes into the Dependency Injection container using the Registry Pattern and then select them at run time
Code: github.com/toggenation/di-registry-pattern
มุมมอง: 149
วีดีโอ
CakePHP 5 - Case Insensitive Username or Email Login with a Custom Resolver
มุมมอง 1742 หลายเดือนก่อน
Code: github.com/toggenation/cakephp5-with-auth-plugins 0:6:04 Adding a database field using a migration 0:7:30 Modifying Application.php to allow email/username auth 0:15:07 Debugging SQL queries 0:21:00 Ajax Token auth with GET or POST
Use PHPMailer or SwiftMailer to create and send messages with the GMail API quickstart sample script
มุมมอง 1252 หลายเดือนก่อน
How to create and send Mime formatted emails using PHPMailer or SwiftMailer and then send them using the GMail API and the quickstart.php sample script from github.com/googleworkspace/php-samples/blob/main/gmail/quickstart/quickstart.php Includes attaching files and embedding images inline.
Deploy OPNSense in Azure from Scratch
มุมมอง 8192 หลายเดือนก่อน
- How to create and upload an OPNSense Hyper-V image and deploy it in Azure in a 2 NIC configuration - Includes creating Azure virtual network, network interface card & routing table - Deploy a Ubuntu Virtual Machine behind OPNSense and use port forwarding to publish SSH on a non-standard port and a HTTP Web server - Configure OpenVPN Remote Access using OpenVPN Connect client on Windows 11 00:...
Sending Email using the GMail API - OAuth2 Modern Authentication
มุมมอง 2.3K3 หลายเดือนก่อน
Google will be disabling access to less secure apps soon. This is how to setup, authenticate and send an email using the quickstart.php demo PHP file from the Google Workspace developer samples GitHub repo: github.com/googleworkspace/php-samples/blob/main/gmail/quickstart/quickstart.php Code for this video: github.com/toggenation/gmail-api-example If I get time this first example will build to ...
CakePHP 5 - Install Live and Development Environments on Ubuntu 24.04 VM
มุมมอง 1654 หลายเดือนก่อน
Parallel php8.3-fpm live and test environments Installing and connecting to Postgres DB Passing environment variables via dotenv or fastcgi_params Sample code: github.com/toggenation/cakephp-live-test-sxs 00:00 Intro 00:57 Enabling password-less sudo for a user 01:50 Displaying the IP address of the VM 03:40 Generate a SSH key on Windows 11 and configuring VM for public key access 07:06 Install...
CakePHP 5 - Modelless Form + EncryptedCookieMiddleware
มุมมอง 2437 หลายเดือนก่อน
Shows how to save and pre-fill fields in a Modelless Form from Cookies generated by the Encrypted Cookie Middleware
CakePHP 5 - Token Authentication
มุมมอง 8007 หลายเดือนก่อน
Configuring token based authentication github.com/toggenation/cakephp5-with-auth-plugins
CakePHP 5 - Basic Testing using Migrations, Seeds, Fixtures & Fixture Factories
มุมมอง 1K11 หลายเดือนก่อน
This is a rough run through of tests Covers: - Getting the default PagesControllerTest's running after upgrading to CakePHP 5. Include upgrading and tweaking phpunit.xml.dist - Fixing tests to stop them failing due to Authentication redirects - Building your own custom test schema creator tool (creates tables from default database in the test databases) - Using Fixtures - Basic use of Fixture F...
CakePHP 5 - Upgrade from CakePHP 4 to 5
มุมมอง 99511 หลายเดือนก่อน
Demo of upgrading from CakePHP 4.4.10 to CakePHP 5.0.2 1:08 Upgrade to ErrorTrap and ExceptionTrap classes 5:05 Using the upgrade tool 11:02 Re-enable global functions 12:19 Fixing some deprecations 14:49 The difference between CakePHP 4 and 5 paginate contain
Create pfSense Community Edition in Azure with 2 NICs using the Azure Portal
มุมมอง 2Kปีที่แล้ว
Warning: The latest version of pfSense CE (2.7.2) has broken package installation and update after it is launched in Azure. You might want to try Opnsense if you are standing up a low cost development or testing environment. Please see my previous "pfSense Community Edition on Azure with 2 NICs using Powershell" video on how to create and upload the pfSense Community Edition VHD. Then continue ...
OpenVPN Access Server in Azure - LDAP Auth, MFA, NAT & Routing modes
มุมมอง 558ปีที่แล้ว
Covers creating the Virtual Network to enabling LDAP Authentication against a Domain Controller, Multi-Factor Authentication using Google or Microsoft Authenticator and finally switching from NAT to Routing mode. 00:00 Intro 00:39 Create Virtual Network 02:38 Deploy OpenVPN Access Server from Marketplace 03:42 Create a RSA SSH priv/pub key for authenticating with OpenVPN AS 05:50 Deploy a Domai...
PFSense Community Edition on Azure with 2 NICs using Powershell
มุมมอง 4Kปีที่แล้ว
Note: Loading pfSense CE (2.7.2) into Azure as below results in broken updates and package install functionality. Look at OPNSense as an alternative. Covers installing pfSense Community Edition in Hyper-V, uploading the VHD to Azure and configuring for 2 NICs with Powershell to protect a back end subnet and have the back end devices use the pfSense as the firewall / network gateway. Powershell ...
CakePHP 4 - Creating a Plugin and Helper to Embed phpinfo output into a view
มุมมอง 238ปีที่แล้ว
2:10 How to create a PhpInfo Plugin & Info Helper with bin/cake bake. 4:40 Use ob_get_contents to capture output into a variable 21:22 Shows pushing the Plugin to GitHub and then using composer to install it into the vendor directory
CakePHP 4 - Caching the Output of Long Running Processes & Dependency Injecting a Service Class
มุมมอง 189ปีที่แล้ว
Caching the output of long running processes. Adding a Service Class to the Dependency Injection container.
CakePHP 4 - Nginx+PHP 8.2 with XDebug+Mysql on Windows 11
มุมมอง 486ปีที่แล้ว
CakePHP 4 - Nginx PHP 8.2 with XDebug Mysql on Windows 11
CakePHP 4 - Enabling DebugKit Error Screen Links for VSCode in WSL and Docker Containers
มุมมอง 183ปีที่แล้ว
CakePHP 4 - Enabling DebugKit Error Screen Links for VSCode in WSL and Docker Containers
CakePHP 4 - 4/4 InertiaJS - React Return to same page after delete
มุมมอง 78ปีที่แล้ว
CakePHP 4 - 4/4 InertiaJS - React Return to same page after delete
CakePHP 4 - 2/4 Create an Inertia React Index Page
มุมมอง 118ปีที่แล้ว
CakePHP 4 - 2/4 Create an Inertia React Index Page
CakePHP 4 - 3/4 Implementing pagination using InertiaJS - React
มุมมอง 153ปีที่แล้ว
CakePHP 4 - 3/4 Implementing pagination using InertiaJS - React
CakePHP 4 - 1/4 Install and Configure Inertia and React in an Existing BootstrapUI Application
มุมมอง 477ปีที่แล้ว
CakePHP 4 - 1/4 Install and Configure Inertia and React in an Existing BootstrapUI Application
CakePHP 4 - Using the Muffin/Footprint Plugin to Pass Logged in User Info to the Model Layer
มุมมอง 138ปีที่แล้ว
CakePHP 4 - Using the Muffin/Footprint Plugin to Pass Logged in User Info to the Model Layer
CakePHP 4 - InertiaJS and React using the cakephp-inertiajs adaptor by Ishan Vyas
มุมมอง 672ปีที่แล้ว
CakePHP 4 - InertiaJS and React using the cakephp-inertiajs adaptor by Ishan Vyas
CakePHP 4 - Enable the Tree Behavior in a table with existing records
มุมมอง 318ปีที่แล้ว
CakePHP 4 - Enable the Tree Behavior in a table with existing records
CakePHP 4 - Creating a Form to Edit Multiple Levels of Associated Data
มุมมอง 576ปีที่แล้ว
CakePHP 4 - Creating a Form to Edit Multiple Levels of Associated Data
CakePHP 4 - Saving multiple levels of associated data
มุมมอง 551ปีที่แล้ว
CakePHP 4 - Saving multiple levels of associated data
CakePHP 4 - Redirecting back to the correct index page on Delete and Edit
มุมมอง 169ปีที่แล้ว
CakePHP 4 - Redirecting back to the correct index page on Delete and Edit
CakePHP 4 - Using the Tree Behavior to create a Bootstrap 5 menu
มุมมอง 879ปีที่แล้ว
CakePHP 4 - Using the Tree Behavior to create a Bootstrap 5 menu
How do I send an HTML message? When I replace "Body here" with HTML, it comes through as HTML source code instead of being interpreted as an HTML document.
I figured it out: I had to add *Content-Type: text/html; charset=UTF-8* after the subject line.
Instead of doing it totally low level you can use SwitfMailer or PHPMailer to generate the Message th-cam.com/video/l7hCoF58zTM/w-d-xo.html
This worked perfectly, thanks so much.
Glad it helped. I find TH-cam is a very useful knowledge library and learning resource
Thanks mate, helped me a lot.
you saved my live! thanks^^
Nice example of how to implement a custom registry and using DI to properly implement it in your controller actions. The only thing I would have done differently is the fact, that you pass down the controller instance to the PaymentGateway just to show a flash message. I'd rather leave the PaymentGateway as it is (without the controller) and make that pay() method a void method - meaning the happy path is if everything has gone right and no errors occured. With that you can just call the ->pay() method in your controller and afterwards a success flash message. BUT if something goes wrong inside the PaymentGateway I'd throw a custom exception with all the infos needed inside that exception. This can then be try-catched in the controller and therefore easily be put out via a Flash Message as well. I'd also put lots of logging inside the payment gateway as well to know exactly which things have worked (or not) with which input. Another reason I'd also leave the PaymentGateway "alone" without any connection to the controller would be the fact, that you can then easily implement an async queue to process incoming payments. Depending on your application size and/or the payment processor it could very well be, that these kind of payment processing requests can take a long time. And letting your users wait in the browser for a long time is not good.
any tips on adding additional WAN?
Sadly no. I've never implemented it.
Will OpenVPN work on this or site-to-site VPN be able to connect to the LAN VM? I'm having trouble connecting to the VM in LAN while connected through OpenVPN. the Port forward SSH is working, connecting directly to the local backend IP is not working.
Hi TheCodeAkira, Check your routing setup in the VNET and also check that you have allow rules setup correctly for each network to allow traffic to go through. I usually go into Status => System Logs => Firewall to see if things are blocked by the absense of allow rules.
@@toggenation Found it, added the openvpn subnet to the Backend route and now I'm able to access the local VM. Awesome. Thank you
can u show a simple implementation auth token with magic link? im beginner in cakephp and i liked because it works on hostinger hosting website(no vps hosting, for example). I like your style sir James McDonald, keep going!!!
any idea how generate ssr with inertia cakephp i create plugin work fine with vite inertia but i failed to generate ssr thank you
I'm using upgrade tool particulary to upgrade from 4.5 to 5.x. But I get an error: Call to undefined method Cake\Upgrade\Application::pluginEvents() in /upgrade/vendor/cakephp/console/CommandRunner.php
What is the Pre Rector commit for? I am upgrading my project from 4.5 to 5.0 but its kind a missing of AbstractRector and now the pluginEvents
That is so after your run the upgrader you can see any code changes if any that the tool makes.
@@toggenation I'm using upgrade tool particulary to upgrade from 4.5 to 5.x. But I get an error: Call to undefined method Cake\Upgrade\Application::pluginEvents() in /upgrade/vendor/cakephp/console/CommandRunner.php
i created this pfsense vm and test vm in a resource group which already consisted a VM, now I want to make the pfsense work as a firewall for that VM, so can you please make a video on how to connect the pfsense VM with already existing VM in a resource group on azure.
Nice. Thank you. I manage to done this 2 years ago with old BSD . Now I want to upgrade. My problem : the azure backup not working without the Agent installed and configured for azure. Is there a solution???
You can try to manually install the agent github.com/Azure/WALinuxAgent/ Plan B is just take a snaphot and test if you can restore to a new VM and it runs OK
Not sure how similar pfSense is to opnSense but this is how I got the agent running in opnSense toggen.com.au/it-tips/getting-the-azure-agent-running-in-opnsense/
There is a Opensense VM template in Azure so you could skip the HyperV part
Better to use your own image. You have to pay 0.05$/hr for that one + cost of azure machine. + in case they remove that template (it happens alot), you can't restore/create a new machine from snapshot as it require purchase plan which deleted.
Cool, also you can add freeradius package, and configure authentication with username, password and MFA.
Yes! 2FA on a shoestring. Love it!
James, thank you for your time making the video
Thank you very much, I managed to do it with your explanation, but how do I add attachments when sending an email? Can you help me? Hugs from Brazil
You can pull in either PHPMailer or SwiftMailer and create an email with attachments. See => th-cam.com/video/l7hCoF58zTM/w-d-xo.html
Thank you
First of all, thank you very much for this detailed tutorial! I've got a question regarding the layout. At 50:50, you delete all the PHP code from the layout. However, in my project I'm using quite a few CakePHP elements (e.g. header, nav-bar, sidebar etc.) to assemble my layout in a structured way. How can I still use these elements, when configuring the layout with Intertia?
Great video. Unfortunately doesn't work for me. What about the requirements for Azure VMs, for example the Azure VM Guest Agent?
Same thing. Anyone manage to install the agent?
This is what I need. Thanks for sharing :)
No worries. Good to have some DIY options in Azure.
🎉🎉
Could you record a lesson that discusses the topic of sessions, cookies and cache in more detail? (redis, memcache etc)
Hello, your tutorials are very interesting and help me a lot in learning cakephp. Thank you.
I couldn't for the life of me figure it out, didn't know it was that simple. Many thanks!
Hi, could you please make a video on how to make a file management system, I've looked everywhere on the internet and I can't find how to do it, do you think you can do it? I just basically wanna know how to organize files with granted permissions depending on the user :(
Thank you! Easy instructions, but a bit difficult to follow along with the back-and-forth. Azure was a lot faster for me, unsure why. Given that Netgate seems to sabotage CE installations in Azure by automatically removing repo information and thus not allowing updates if pfSense CE detects it is running there, I will be using your method to install a different brand if pfSense gives me any more problems.
Would like to see a video that shows how this can be done with the service class being used by both the CLI and the Controller
Hello James! Cakephp is an underrated framework. Are you planning a full course of application development for version 5?
Hi @GermanJet5, No I'm not planning to do a course. I tend to post stuff I've found interesting personally and hopefully useful to others. I feel I lack the skill depth to create something truly compelling for CakePHP in course format.
Test Users ja tgn
Thanks, man! I wanted to clone a Windows 11 installation on a 1tb SSD to a 2tb so as to get more free space. However, there were several utility partitions, including the EFI firmware, between the C: partition and the free space. Following your example, I used Rufus and created a bootable USB stick with gparted. Gparted easily moved all these smaller partitions to the end of the space, in point and click fashion. No need for expensive subscription-only tools!
Aweseom r.j. I'm glad you got a good result... This video is rough and unedited but it gives the general idea.
Good job ❤❤
Thank you very much sir!
James! Thanks! This video was very useful and insightfull. Thanks!
Very useful lessons. Thanks to them, learning the framework becomes easier and more interesting. I'm really looking forward to new videos on cakephp. Thank you!
It helps me a lot. Thank you
Great video, but couldn't get azure agent to install
A way of figuring out how to get the agent to install would be to check the Microsoft official FreeBSD Images as they have the agent installed already learn.microsoft.com/en-us/azure/virtual-machines/linux/freebsd-intro-on-azure#overview Some tweaking required I would imagine
This is for opnSense but may work for pfSense toggen.com.au/it-tips/getting-the-azure-agent-running-in-opnsense/
Hi James, I've been stuck at 49.00 for a while now, I keep getting the "Authorization\Exception\ForbiddenException" error - any tips on how to debug that please!!!
Hi @Reinnyny, Have you got your config/permissions.php file in place? I had a typo when creating the video so check for typos.
Hello, in the meantime I have deployed a new Pfsense instance with version 2.7.2 in Azure and noticed that the Packege Manager is not available. I get the error message Unable to retrieve package information. Have you had similar experiences?
Yes, I have the same issue and have spent hours troubleshooting it.
On Netgate forums people write that this is intended by Netgate to push pfsense plus in azure. I have spent hours trying to reach the packet manager. I don't even know if there are other functions that don't work.
Same issue here, has anyone figured it out?
@@zax123 I just uploaded the latest CE build and have the same issue in Azure. I'm pretty confident that Netgate is blocking connections from Azure Source IPs unless you're running Plus. My next test was going to be to force the default route from the Azure PFSense to an "on-prem" gateway so it sources from a different IP range to confirm this. NOTE: OPNSense doesn't have this issue.
I found a post on the Netgate forums that also had a solution. It has to do with pfSense-repoc and pfSense-repoc-static deleting the content of the pfSense repos folder. Renaming them and creating an empty file to replace them stops them. It seems I can't post the link here, TH-cam doesn't like it, but the thread is named _"Branch" dropdown empty, /usr/local/etc/pfSense/pkg/repos/ empty - 2.7.2 CE_
Thanks so much. recent version of pfsense i think that fixes the lock out rule
Thank you. That IdentityFile configuration line is what I was missing.
Thanks a lot! This was very helpful.
What exactly was that?! Was it that you wanted to show off your gparted skills?! 'Cos by far wasn't an exhibit to make some others understand what exactly you're doing and why! As a proof you're such a lazy dumb ass is that you did this video with no voice help for explaining and justifying your steps! Besides, other important part is missing: How can you merge the partitions, since after cloning, Rescuezilla splits the entire destination drive into two partitions which not everybody is happy with and, you didn't have a solution for that issue at all!😏
Hello James! Thanks for this Tut! :) Question: Why did you create that @VAR in minute 6:15?
Hi, I use the PHP Intelephense extension with VS Code the @var ... is so I can get editor hinting and auto complete working. I find it easier to let the IDE do the work and not my memory 😃
Is it mandatory to add migrations.i don't have that folder under config. I am going to upgrade 4.5 to 5.0
Hi, No migrations are just for managing your database schema. You can ignore any reference to migrations when you do the upgrade. But if you have to tweak the database as you upgrade or continue to develop your app migrations are handy to capture the history of changes.
Thank you for this fantastic presentation James. Especially with the discontinuation of the Basic VPN gateway in the fall of 2025, this is a cost-effective solution for s2s and p2s VPN connections
Glad it helped ;)
Amazing, Amazing!!! Thank you!
Great video, well done!
Thanks :)
Very nice video going through all the necessary information and available options to build a solid testsuite foundation, well done.
21:45 yes, because the connect() method was moved from the Connection class to the Driver class. If you look at the current state of the cakephp/app template inside that specific templates/Pages/home.php file you can see how it's changed. Just getting the connection object via its name doesn't mean your config data is correct. It just means you have a datasource configured with that given name.
10:00 Yes, our documentation is not up2date in that specific spot but if you look at the PHPUnit 10 upgrade docs in the "Migration Guides" section of the 5.x book you will see everything you need to do ;)
Thanks for pointing to that PHPUnit migration guide Kevin I could have saved myself some hassle if I had of followed it. book.cakephp.org/5/en/appendices/phpunit10.html