Jamie Peters

Laravel / PHP / JavaScript Developer

Personal Projects

Below are a few examples of personal projects I have done outside of employment.

Coeliac Sanctuary

www.coeliacsanctuary.co.uk

Coeliac Sanctuary is my fiancees business. It was originally started in August 2014 as just Gluten Free blog for the Coeliac community, along with recipes, places to eat guide and reviews. It is currently powered by a custom built PHP MVC Framework utilising Twig templates and jQuery on the front end.

Later in 2016 I created an online shop for the website, still using raw vanilla PHP and utilising the Stripe and PayPal APIs for handling payments.

A basic mobile app was created using Phone Gap, primarily linking to the eating out guide section on the website. The app is used to display eateries in the database on an embedded Google map around the users location. The app was originally written in basic HTML, SCSS and JQuery.

I am currently in the process of a creating new major version of the website, including rewriting all the code from scratch using TDD and the Laravel Framework along with Tailwind CSS and Vue Components. I am also using this opportunity to create a new, more optimised MySQL data structure for the website, which includes writing scripts to import and migrate the existing data structure into the new Laravel version.

Project Images

Below are some images related to this project, images can be clicked to enlarge them.

The current Live version of Coeliac Sanctuary, which is using a custom PHP MVC Framework

The new version of Coeliac Sanctuary currently in development using Laravel, Tailwind CSS and Vue.

Architect is a Laravel Admin Package I am currently developing as a Vue SPA and using TDD for the Laravel / API back end.

Architect is powered using a concept I have created called Blueprints and Plans, a Blueprint links to an Eloquent model, and each Plan then links to the columns in the model using text fields and other form elements.

Below is a basic example of a Blueprint, the Blueprint is for a User Model and includes plans for the users name, email, password and the created at timestamp. The password and created at plans also have modifiers on them to hide it on the index view, and hide it on the form view respectively.

Architect will use this Blueprint and render a tabular list of the users in the application and display their name, email and the date they were created, and then the add new and edit forms will render inputs for their name, email and password.

Project Images

Below are some images related to this project, images can be clicked to enlarge them.

The tabular list of all records built from a Blueprint

The form generated from a Blueprint to edit a blog.

Code Sample

<?php

namespace App\Architect\Blueprints;

use App\User as UserModel;
use JPeters\Architect\Blueprints\Blueprint;
use JPeters\Architect\Plans\DateTime;
use JPeters\Architect\Plans\Password;
use JPeters\Architect\Plans\Textfield;

class User extends Blueprint
{
    public function model(): string
    {
        return UserModel::class;
    }

    public function plans(): array
    {
        return [
            new Textfield('name'),

            new Textfield('email'),

            (new Password('password'))->hideOnIndex(),

            (new DateTime('created_at'))->hideOnForms(),
        ];
    }
}

A simple package I originally created for Coeliac Sanctuary and extracted out into a package when I started using the same functionality in other projects.

The idea is to be able to dependency inject the Page Builder class into a controller, and then the class can be used to specify a page title, meta information etc and then return a fully rendered Blade view in the response with any appropriate data.

Below is a code sample from a Controller, specifying a page title and meta description and returning a welcome view.

Code Sample

<?php

namespace App\Http\Controllers;

use Carbon\Carbon;
use JPeters\PageViewBuilder\Page;

class WelcomeController extends Controller
{
    public function get(Page $page)
    {
        return $page->setPageTitle('Welcome')
            ->setMetaDescription('Welcome to my Laravel App')
            ->render('welcome', [
               'date' => Carbon::now(),
            ]);
    }
}

This website is a very simple Laravel app that uses my Page View Builder above to render the views.

Along with being written in Laravel this website also uses Tailwind CSS and Vue components for additional functionality, such as the image viewers and modals, and Font Awesome SVG icons.