Author: admin

  • Work Diary #10

    Filament Forms

    In the last work diary, I covered how easy it was to link select fields … where values of select B are dependant on the value of select A.

    When you get an excessive amount of options though its nice to add a searchable field:

    Forms\Components\Select::make('venue_id')
    ->searchable()
    ->preload()

    So easy!

    But Filament gets even better.

    You can add an inline form to the select!

    ->createOptionForm(Venue::getForm())
    ->editOptionForm(Venue::getForm())

    The getForm function simply returns an array of form elements like you would get in the normal filament resource files.

    The amount of work this saves the developer is crazy good.

    Filament is really very good at first glance although I’ve noticed some very minor bugs.

  • Day 69

    Felt a bit refreshed past few days.

    Here’s what’s going on in the main

    1 – Still helping out on the DXP project … this is a Digital Experience Platform which manages websites at scale. We have a working version up and running on BetTodayUSA and are closing in on releasing the beta version very shortly, which will allow us to do a lot more public testing.

    2 – Helping a leading UK holiday rental company transition into a new booking software infrastructure.

    3 – Early stage discussions on AI startup for a scaled sentiment analysis

    4 – Also in early discussions with a friend who is amazing at producing leads through various data crawling and AI analysis techniques. Trying to figure out way forward.

    5 – I am building my own platform that is capable of being the infrastructure that all these projects (and more) would run on. It’s a relatively thin layer, but super useful.

    6 – Early stages of working with a 3D avatar

  • Work Diary #9 – Laravel Filament

    Enums can be super powerful …

    … use them in factories

    'region' => fake()->randomElement(Region::class),

    Filament Forms are really robust.

    Forms\Components\Select::make('region')
    
    ->enum(Region::class) // <-- This enforces validation!
    
    ->options(Region::class)
    
    ->required(),

    These days you really don’t want to spend any time doing form validation. It’s already been done. I like the above because it will ensure that even on frontend tampering it still means server side validation will enforce the values to be one of the enums. Honestly, that’s a small chunk of boilerplate that you don’t need to do.

    Laravel Shift :: Blueprint

    Blueprint gets the migrations for you.

    Get Filament To Generate The CRUD UI For You

    php artisan make:filament-resource Venue --generate

    Dependant Select Pickers

    Since Filament is a LiveWire app, all form elements are set with wire:model, with none of them being live updates. But you can easily change them live which means on any change, we send a request to the server and re-render the component. This gives the opportunity to query for options. Such as:

    Forms\Components\Select::make('region')
    
    ->live()
    
    ->enum(Region::class)
    
    ->options(Region::class)
    
    ->required(),
    
    Forms\Components\Select::make('venue_id')
    
    ->relationship('venue', 'name', modifyQueryUsing: function (Builder $query, Forms\Get $get) {
    
    ray($get('region'));
    
    return $query->where('region', $get('region'));
    
    }),

    The keys here are:

    • Using a custom closure in modifyQueryUsing
    • Passing the Forms\Get $get method into that closure
    • Using a query on region to match the selected region value

    Spatie Ray Debugging

    Debugging makes software programming so much easier. The Spatie crew have made ‘Ray’ which is a real-time logging utility. I did buy Herd Pro for this purpose, but I will probably end up up returning the Hero Pro licence since it’s not as useful as I thought … and stick with Ray. Highly recommend ray

  • Days 65 – 68 – Random Thoughts!

    Elimating Distractions, Interruptions and Overcommunication

    So last few weeks I’ve fallen in the habit of logging onto slack early in the morning; and I’d catch up with a developer on a project. This is still a very much needed ‘thing’ to be doing … but the problem is, it immediately scrambles my brain for the day.

    It’s the same for loading up your brain with any sort of communication early in the morning. That’s the time when you just want to use your fresh mind to work on important challenges.

    Emails are never important enough to get done first thing, although many will say they are. If they are that important, get them done the night before and send them. But to sacrifice your fresh mental energy to deal with messages coming in from slack, whatsapp, email, discord … it’s such a waste; and when you are self-employed and on your own time you just can’t afford to waste that energy.

    There’s always exceptions to the rule … that one important email which seals a deal, or solves an urgent and pressing matter. But in general, emails and all messaging will be abstracted away from us in the future world of AI Personal Assistants.

    I am guilty of it as well – ‘brain farting’ when I have an idea that I think is so great that I need to tell someone. Or having found something ‘great’, forwarding it to someone who I think will find it useful. But all I’m doing is consuming their attention and perhaps breaking their concentration on something potentially important.

    So the main thing going forward is no communications at least until 3pm. That’s normally the time when my fresh mind runs out of juice. Between 3pm and 8pm I generally don’t work very effectively.

    Overwhelm & Stress

    Recently hit a point where I got overly stressed with all the things going on. Partly that was down to me not managing the over communication going on in my life.

    It was also down to me not single handling tasks, and trying to manage more than one thing at a time. I think it was proven in a repeatable scientific method way that multi-tasking was insanely inefficient. So, as I was beginning to have more than one thing on my mind at any one time… it was tearing me in several directions.

    Also, the notebook that i started 70 days ago (ish), is now full… and whilst all the ideas are in there … it’s now time for a brand new clean notebook that builds on everything I’ve been working out over last few months.

    I’ve now started back at zero point – choose the key projects and short term goals for next thirty days within them, and cycle between them … without the overhead of multi-tasking, digital overwhelm, or without letting too many people into my head.

    Sports Psychology & Visualisation In Business

    Sports psychology is one of my favourite things to study, and in an different quantum timeline, maybe I would have been an athlete … but that didn’t happen for whatever reasons and no reason to not accept it. But you can apply SP to your own daily business life; and many would say it really is the key to their rather large successes.

    The very core of SP is in learning to work with your mind in a very specific way. Your ‘mind’ is actually the result of the central nervous system … (read Psychocybernetics for a new paradigm change on the subconscious) and it works pretty much like you would expect a robot to behave. You give it a clear goal that your biological machine can understand, and it will go and do it.

    We live and operate both as the passengers and drivers of ourselves. It’s a weird paradox that most don’t get to appreciate unless you unravel your mind and wake up to what’s beyond it.

    Point is, have a clear list of priorities… then mentally cycle through them – seeing what they look like at the end of completion. The key is knowing you won’t visualise it perfectly done first time, so just hold the intention, outcome and feeling of winning at it, and see what pictures come up into your mind. You will gain insights, and as you rewind from the end point to now, you will map out the journey in a way that your subconscious mind can understand better.

    I’d got out of the habit of doing this many years ago, but in reality, it’s the only way of true mental control.

  • Day 64 – An example of AI getting it wrong

    With Cursor, on a 1000 line script, it could not find where an API token was until I specified it.

    This has happened more regularly recently. The AI just gets basic shit wrong, or it leaves code in there which doesn’t need to be there. I’ll happily admit vibe coding is great, and I’ll also happily admit I’m wrong … but I think you really need to know what you are doing with AI else it becomes a mess quickly.

  • Day 63 – Are you seeing it yet?

    The generative industry is moving so fast; with images, video, music, speech, written word all now improving at a rapid place.

    Many people are not seeing it.

    Today I was able to build a web tool that may not be great for production but is really quite good for the debugging and investigation of an API. The ‘AI’ was able to understand some of my complex but no quite so explanatory prompts in a way that blew me away and was able to produce some really valuable work.

    I don’t fully know whether programming is going to die as a profession. I think *eventually* yes, it probably will be abstracted away much like assembly language has been. All the patterns will be fully understood, trained, tweaked and they will be able to replicate huge swaths of code that actually create a great product.

    When you do get into complex systems though – whilst I’m no silicon valley person – it does seem that there are limitations on it, and it must have an experienced human (developer) guiding it to get it to the last 5% of properly working.

    That’s just programming. The rest of the generative industry is equally as mind blowing.

    Are people really seeing what’s going on?

    And do they understand the magnitude?

    And are they embracing?

    Work Diary

    Laravel Herd & Filament

    Whilst I have been prototyping with Vanilla, I checked out Filament last night on Laracasts:

    Filament Forms

    The Form library alone is complete enough to warrant using Filament. It has so many small quality of life features that add up. From memory here’s a few that convinced me:

    • Really nice prefix and suffix options
    • Really nice icon and description and helper text integrations
    • Excellent search integration into long selects in one line of code
    • A really easy wizard workflow setup
    • Excellent integration of new entity creation when a user needs to be able to add a new option to a select list
    • Easy linking between SELECTS

    This is of course on top of it working solidly as you would expect.

    So, I’m flipping my prototype to use Filament … which is an excellent basis going forward.

    Filament File Uploads

    In one line, its got a drag and drop file upload, with image preview built in. Uses filecon JS

  • Day 62 – Laravel + Frontend Tooling + Random Thoughts

    Today, I was looking at making a final decision on whether to use a React or Vue frontend. My prototype has been coming along, but I had just been using plain PHP blade templates with Vanilla Javascript for quickness.

    I think web development has got totally overcomplicated, and that you can go a long way with vanilla stuff. I would never start a PHP project without Laravel however, since I know it has virtually everything I need to build whatever I want.

    Since LLMs have come about, there’s a lot to be said for just writing functionality in javascript; but ultimately you do want to benefit from a frontend framework. State management, DOM manipulation and an event bus are reasons why I want to use them. And of course, components. Was a shame the official WebComponent standard is so poor.

    React Or Vue? Or Livewire?

    The age old debate for a developer. It’s annoying quite frankly at this point to continually decide what to use. I prefer the simplicity of Vue syntax, but I often use graduates from a bootcamp that teaches React, and I have bought quite a few premium templates that React also. To be honest though, with LLMs it’s so easy to switch between.

    Then there’s LiveWire. Each time I’ve tried to get into LiveWire I’ve been put off by it. But I had the same resistance when I got into Flutter and once I persevered I loved it.

    In order to decide on the choice, I looked into Filament.

    Filament

    Filament is TALL stack (Tailwind, Alpine, Laravel, Livewire) … and i’ve used previous versions being fairly impressed. This would be a bit of a few steps back in order to take a leap forward, but taking a look at the excellent Laracasts for it, I’m starting to see the benefits.

    • The resource creation gives the CRUD UI upfront … this is slightly different from the CRUD UI generation that I have been working on… since my ones are more ‘on-the-fly’ than ones that get defined in the yaml files. Still the resource creation results in a full on CRUD interface with sortable datatables out of the box.
    • The form library is pretty much flawless. No more messing about with forms.
    • Select options can be configured with enums and gets all enforced really nicely.
    • Multi-tenant stuff out of the box
    • Can hook up with Laravel Stripe for subscriptions

    Laravel Herd

    • I’ve been a fan of Laravel Sail for a while, but that’s only because it abstracted complication away from me. Whilst I get tired of learning new things, that’s no reason to not embrace something that works even better. Enter Laravel Herd. Some benefits:
      • I don’t have to use Docker Desktop. Which decides to hog a huge amount of system memory. You can change this in settings, but overall Herd is a lot faster.
      • For some reason, my local composer would not install the laravel CLI tool to my local machine. So I had to resort to installing Laravel via some shell scripts. Herd got it installed immediately
      • Herd includes TinkerWell, some debugging tools, and general system configuration

    Consultancy Fees

    I’m getting tired of being asked to ‘look into stuff’ and expecting it to be done for free. Need to have a consultancy page hooked up to a simple credit card thing.

  • Day 61 – Prototyping

    I’ve been using my very basic prototype to store data of ‘things’ in my life – I use LLMs to setup this data; and then I have a UI that allows me to interact with the data.

    One of the things I’ve been doing with it is keeping track of projects, ideas and tasks … and the problem I started to face was I didn’t like the UI I had used as the index for these data items.

    So last week I’d spotted a nice slider effect that I liked; and today I decided to put time into my own project for once again; and just implement that.

    So now I still have a CRUD interface for my data, but I’ve also integrated the beginnings of a nice swiper interface so that I can swipe through each ‘thing’ one at a time; consider it one at a time; and then move onto the next.

    I made an animated gif to briefly showcase it. Since I’m running out of time today, I’ll leave it here … but this is currently cycling through my blueprints … it’s a good start and going to be a much more enjoyable way of cycling through the things going on.

    And of course eventually the images will be generated according to the content.

    More updates tommorow.

  • Day 58 – 60- Quick Catchup & MCP -Model Context Protocol Revolution

    It’s been a few days since I posted last. I’m going to let myself off, but resolve to do better in the future – since I do want to keep posting on a daily basis but I am aware I want to make the posts more valuable; so I feel they represent value that can then go onto LinkedIn, and the other social networks.

    Things are definitely building in my mind; and projects are coming along. However, still a long way from anything concrete taking off.

    For the moment would just like to talk about MCP, because it really is a very significant milestone in the AI world. (Image context from OpenAI was another one recently).

    MCP

    Model Context Protocol was announced in Nov 2024 by Anthropic.

    This is a big step forward since it has standardised how language models can/should interact with external tools.

    In order for LLMs to be further useful, they need to be able to action things.

    I’m guessing that once Anthropic had integrated a couple of tools with their LLMs they realised it would be better to have a standard way of doing that … and from that they came up with the MCP architecture.

    At first understanding, giving a language model a standard way of interfacing with the outside world is a bit of a game-changer and there are already a ton of integrations that we can use straight away. Things are happening really fast.

    Core Architecture

    Essentially, you have an application (called the Host), and this has a Client inside it.

    The Client maintains connection to the Servers which have access to the tools you want the LLMs to connect to.

    Protocol Layer

    It’s fairly simple … you have:

    • Requests
    • Notifications
    • Results

    You have functions that:

    • Handle incoming requests
    • Send requests and await response
    • Handle income notification
    • Send a notification

    Transport Layer

    All transport layers use JSONRPC

    JSON-RPC Request Object

    • jsonrpc : always going to be “2.0”
    • method
    • params (optional)
    • id

    Without an ID, it is considered a notification that doesnt expect a response. In fact, servers MUST NOT reply to a notification.

    JSON-RPC Response Object

    • jsonrpc (version string)
    • result
    • error
    • id

    To be clear, MCP is a standard way – a proposed specification that multiple parties can agree on – for how language models will interact with outside tools.

    Protocols are vital in tech. We have TCP-IP and email, which you use all the time. Without that agreement, we could have had an incredibly fractured internet.

    When companies and developers can agree to do things in a certain way, it makes it easier to make systems.

    Using MCP I assume is very much like working with interfaces. If you code an LLM up to work with your own tools and then for whatever reason you decide to switch LLMs … then using a protocol would mean there’s no lost work – because the new one will use exactly the same interface as the current one.

    Reference

    4 Request object

    A rpc call is represented by sending a Request object to a Server. The Request object has the following members:jsonrpcA String specifying the version of the JSON-RPC protocol. MUST be exactly “2.0”.methodA String containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.paramsA Structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.idAn identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]

    The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.

    [1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.

    [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.

  • Day 57 – The Habits Ahead

    Strong results come from doing the right thing many times over.

    Consistency. Discipline.

    I’ve got multiple projects going on at the moment and they can easily fill up my days entirely, without time for the things that will necessarily continue to build the business. But I am dropping things that will actually continue to build the business.

    These are a good additional starting point to my existing habits:

    • Grant and funding research & application
    • Event, conference and networking research
    • Email marketing pipeline
    • Website marketing
    • Social media marketing

    It’s a bit like programming yourself for succeeding; you decide what actions the business would benefit from; or what areas need to be attended to consistently.

    These become the KPIs of your business.