Laravel package to use with Mach3Builders' User Interface
This package contains helper functions to assist our user interface package. see ui.mach3builders.nl for more information on how to get started with it., (*1)
composer require mach3builders/ui
php artisan vendor:publish --tag=public --force
php artisan vendor:publish --tag=config --force
Next install the @mach3builders/ui package and include the CSS and JS needed., (*2)
To show and alert (or notification) you can use the alert helper. After being redirected the alert will show on screen., (*3)
public function store() { alert('message', 'succes'); redirect('/home'); }
Or you could use the helper like this, (*4)
alert('message')->type('succes'); alert('message')->dissmissable(); alert('message')->icon('user'); redirect()->alert('message', 'succes');
Works the same as alert, with a few different methods, (*5)
notify('message')->type('succes'); notify('message')->icon('user'); redirect()->notify('message', 'succes');
Next you need to add the components to your blade layout, (*6)
@include('ui::components.alert') @include('ui::components.notify')
Creates a delete button with a modal to confirm deletion. When the confirm button is pressed a DELETE request is made the the given action., (*7)
@component('ui::actions.delete', ['action' => "/user/{$user->id}"]) Are you sure you want to delete {{ $user->name }} @endcomponent
You can also use the following slots:, (*8)
@component('ui::actions.delete', ['action' => "/model/{$id}"]) {!! trans('taxes.delete-body') !!} @endcomponent
Extend this for the basic mail layout (old version), (*9)
@extends('ui::mail.layout')
You have the following sections, (*10)
Extend this for the basic mail layout (new version), (*11)
@extends('ui::notifications.mail')
You can use the recommended mail formatting of Laravel, (*12)
return (new MailMessage) ->greeting('Hello!') ->line('One of your invoices has been paid!') ->action('View Invoice', $url) ->line('Thank you for using our application!');
return view('ui::invoices.subscription', [ 'customer_company_name' => 'PKHold BV', 'customer_name' => 'Paul Kruijt', 'customer_street' => 'Piet Mondriaansingel 30', 'customer_zipcode' => '3059 PD', 'customer_city' => 'Rotterdam', 'customer_country' => 'Nederland', 'invoice_number' => 'M3B-000001', 'invoice_date' => '01-01-2021', 'payment_id' => 'tr_qwerty', 'platform_name' => 'Mach3Platform', 'plan_name' => 'Professional', 'plan_info' => 'Betaald voor Mach3Builders', 'plan_period' => '01-01-2021 tot 01-01-2022', 'plan_price' => '€ 19,95', 'invoice_tax' => '€ 4,19', 'invoice_total' => '€ 24,14', 'payment_method' => 'iDEAL', ]);