Giter Site home page Giter Site logo

jasmine's Introduction

Jasmine CMS

A Laravel based CMS inspired by Voyager.

Screenshots

Login Login

Bread index Login

Bread Edit Login

Note

Jasmine uses alexusmai/laravel-file-manager
If you are using it already or planing to,
you might need to tweak some configurations to prevent conflicts.

Installation

Require JasmineCMS in your new or existing laravel app
composer require jasminecms/jasmine

Link jasmine public assets to your public folder
php artisan jasmine:link-public-assets

Migrate the database (be sure to make any changes to the default laravel migration prior)
php artisan migrate

Create a user (1st user is super admin)
php artisan jasmine:create-user

Add Jasmine routes to your routes/web.php routes file (you may change the prefix to anything you like)

Route::prefix('jasmine')->group(fn() => Jasmine::routes());

You can now log in to Jasmine,
Navigate to /jasmine
And login

You can register Jasmine assets in your AppServiceProvider

Locales

Jasmine supports multilingual assets, define your content languages like so

Jasmine::registerLocales(['en', 'he']);
Breadables

Breadables can be any model
Run php artisan make:jasmine-model Post to create a Jasmine Model

In your model implement
Jasmine\Jasmine\Bread\BreadableInterface
use trait Jasmine\Jasmine\Bread\Breadable
if the model has multilingual columns, also use trait
Jasmine\Jasmine\Bread\Translatable;
implement missing method

then register your model in AppServiceProvider

Jasmine::registerBreadable(\App\Models\MyModel::class);
Pages

Pages are very similar to models, but function as a single entity instead of a table
Run php artisan make:jasmine-model Post to create a Jasmine Model

Register your pages in AppServiceProvider

Jasmine::registerPage(\App\Pages\Home::class);
Interface locale

You can translate Jasmine interface to any language like so

Jasmine::registerInterfaceLocale('he', 'path/to/locale.json');

the send parameter will accept either a path to your json file or an array of translations
you can copy /resources/front-lang/he.json to get started quickly.

Custom assets

If for some reason you wish to load custom javascript or css you can do it like so

Jasmine::registerCustomStyle('/path/to/style.css');
Jasmine::registerCustomJs('/path/to/app.js');
Permissions

TODO

SideBarMenuItems

You can add items to the sidebar menu like so

// internal
\Jasmine::registerSideBarMenuItem('settings', fn() => [
    'title'    => __('Settings'),
    'icon'   => 'bi-link-45deg text-danger',
    'href'     => route('jasmine.my.route', 'my-param-value'),
    'is-route' => ['r' => 'jasmine.my.route', 'p' => ['my-param' => 'my-param-value']],
], 70);

// external
\Jasmine::registerSideBarMenuItem('site-triple', fn() => [
    'href'   => 'https://triple.co.il',
    'title'  => 'Triple',
    'icon'   => 'bi-link-45deg text-danger',
    'target' => '_blank',
], 100);

TODO: registerSideBarSubMenuItem

Oauth2 SSO

You can register oauth2 providers to enable sso login to jasmine

Facebook example

Jasmine::registerOauth2Sso(
    'Facebook', //name
    'https://www.facebook.com/images/fb_icon_325x325.png', //icon
    '{client_id}',
    '{client_secret}',
    'https://www.facebook.com/v3.3/dialog/oauth',
    'https://graph.facebook.com/v3.3/oauth/access_token',
    ['email'],
    false, // accepts boolean or callback
    function ($token) {
        $token = json_decode($token, true);
        
        $res = Http::asJson()->get('https://graph.facebook.com/v3.3/me', [
            'access_token' => $token['access_token'],
            'fields'       => 'name,email',
        ]);
        
        return [
            'name'  => $res->json('name'),
            'email' => $res->json('email'),
        ];
    },
);

jasmine's People

Contributors

hadasbenmordechai avatar mordisacks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.