Giter Club home page Giter Club logo

laravel-theme-installer's Introduction

Laravel Theme Installer

Latest Stable Version Total Downloads License

This package is a fork of Laravel Module Installer to work with Theme packages. It allows installation of standalone Theme package into the themes/ directory instead of vendor/.

For example if your Theme package name is hexadog/admin-theme then the package will be installed into themes/hexadog/admin directory.

You can specify an alternate directory by including a theme-dir in the extra data in your composer.json file:

"extra": {
    "theme-dir": "custom"
}

Installation

  1. Ensure you have the type set to laravel-theme in your theme's composer.json
  2. Require this package: composer require hexadog/laravel-theme-installer
  3. Require your bespoke theme using Composer

Notes

When working on a theme that is version controlled within an app that is also version controlled, you have to commit and push from inside the Theme directory and then composer update within the app itself to ensure that the latest version of your theme (dependant upon constraint) is specified in your composer.lock file.

Related projects

laravel-theme-installer's People

Contributors

gaetan-hexadog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-theme-installer's Issues

sample code

hello

is there any sample code for controller or something multi lanague how i can manage with multiple theme and

controller how it will work with multiple themes any hint or example something possible ?

multiple routes etc etc

Error when activating themes

Undefined variable: pos

at vendor/hexadog/laravel-themes-manager/src/ThemesManager.php:139
135▕ // normalize module name
136▕ $name = str_replace(['-theme', 'theme-'], '', $name);
137▕ // Check if $name contains vendor
138▕ if (strpos($name, '/') !== false) {
➜ 139▕ return Str::lower($theme->getName()) === Str::lower(substr($name, $pos + 1, strlen($name)));
140▕ } else {
141▕ return $theme->getLowerName() === Str::lower($name);
142▕ }
143▕ });

And the same code is applied also at the above function:

public function has(string $name = null)
{
return !is_null($this->themes->first(function ($theme) use ($name) {
// normalize module name
$name = str_replace(['-theme', 'theme-'], '', $name);
// Check if $name contains vendor
if (strpos($name, '/') !== false) {
return Str::lower($theme->getName()) === Str::lower(substr($name, $pos + 1, strlen($name)));
;
} else {
return $theme->getLowerName() === Str::lower($name);
}
}));
}

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.