sudobee/cygnus

There is no license information available for the latest version (dev-master) of this package.

dev-master 2022-04-17 11:24 UTC

This package is auto-updated.

Last update: 2024-04-27 13:15:31 UTC


README

Installation

  1. Clone into project
git clone git@github.com:sudobeecom/cygnus.git
  1. Add repository to project
"repositories": [
    {
        "type": "path",
        "url": "./cygnus"
    }
],
  1. Require new package
"require": {
    "sudobee/cygnus": "*"
},
  1. Update packages using composer
composer update
  1. Publish/re-publish assets
rm -rf public/vendor/cygnus
php artisan vendor:publish --tag=cygnus-assets
  1. Add app.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="overflow-y-scroll">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Fonts -->
    <link rel="stylesheet" href="{{ asset('fonts/inter/inter.css') }}" />

    <link rel="stylesheet" href="/vendor/cygnus/index.css">
    <script src="/vendor/cygnus/index.js" defer></script>

    <style>
        :root {
            --cygnus-primary-50: 239 246 255;
            --cygnus-primary-100: 219 234 254;
            --cygnus-primary-200: 191 219 254;
            --cygnus-primary-300: 147 197 253;
            --cygnus-primary-400: 96 165 250;
            --cygnus-primary-500: 59 130 246;
            --cygnus-primary-600: 37 99 235;
            --cygnus-primary-700: 29 78 216;
            --cygnus-primary-800: 30 64 175;
            --cygnus-primary-900: 30 58 138;
        }
    </style>
</head>
<body class="antialiased font-base">
    @inertia
</body>
</html>
  1. Add to AppServiceProvider boot() method
Inertia::share([
    "baseUrl" => fn() => URL::to("/"),
    "applicationName" => fn() => env("APP_NAME"),
    "notification" => fn() => Notification::getAndClear(),
    "resetFormIdentifier" => fn() => Session::get(
        "resetFormIdentifier"
    ),
    "csrfToken" => fn() => csrf_token(),
]);
  1. Add to HandleInertiaRequests share() method
/** @var User|null $user */
$user = auth()->check() ? auth()->user() : null;

return array_merge(parent::share($request), [
    "user" => $user?->only("email", "name"),
    "balance" => null,
]);
  1. Add to RouteServiceProvider getHomepage() method
public static function getHomepage(): string
{
    return self::HOME;
}

Update

Run inside your project directory:

git submodule update --remote --merge