GithubHelp home page GithubHelp logo

laravel-theme's People

Contributors

abbasali avatar afbora avatar agelxnash avatar duckzland avatar ethaizone avatar facuz avatar flinty916 avatar harryxu avatar imajkumar avatar jeeinn avatar krzychuw avatar lbausch avatar mirovit avatar morrelinko avatar ngocnh210 avatar polakosz avatar rakesh-beedasy avatar taiyeoguns avatar waiyanmintun avatar xlink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-theme's Issues

Call to undefined method Opis\\Closure\\SerializableClosure::__set_state()

Hi,
I'm using Laravel 7 and when I run php artisan config:cache command I get the following error:

In ConfigCacheCommand.php line 71:
Your configuration files are not serializable.  

In config.php line 660:
Call to undefined method Opis\Closure\SerializableClosure::__set_state() 

I believe this is coming from your package.

After looking on the net, most answers point to this solution.
1) Delete the file bootstrap/cache/config.php
But this file doesn't exist in my project so I can't delete it.
Any idea how to fix this?

Add more than 1.css and 1.jss

Hello i have in assets... style.css color.css and plugins.css... scripts.js and plugins.js

$asset->themePath()->add([
['style', 'css/style.css'],
['script', 'js/scripts.js']
]);

how can add to this?

@Section issue and How to extending the view file

This is my view file

@extends('user/app')


@section('bg-img',Storage::disk('local')->url($post->image))
@section('title',$post->title)
@section('subheading',$post->subtitle)

@section('head')
<link rel="stylesheet" type="text/css" href="{{asset('user/css/prism.css') }}">
@endsection()

@section('main-content')

 <!-- Post Content -->
 <!--1st facebook comment start-->
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v4.0&appId=380768179271978&autoLogAppEvents=1"></script>
<!-- end commnets fb-->

  <article>
    <div class="container">
      <div class="row">
        <div class="col-lg-8 col-offset-2 col-md-10 mx-auto">
          <small>Created at {{ $post->created_at->diffForHumans() }}</small>

            @foreach($post->categories as $category)
            <small class=" float-right" style="margin-right: 20px"> 
                <a href="{{ route('category',$category->slug) }}">{{ $category->name }}</a>
            </small>
            @endforeach()
            {!! htmlspecialchars_decode($post->body) !!}

            <!--Tag cloud.-->
            <h3>Tags clouds</h3>
            @foreach($post->tags as $tag)
            <a href="{{ route('tag',$tag->slug) }}"><small class="float-left" style="margin-right: 20px;border-radius: 5px;border: 1px solid gray;padding: 5px"> 
                {{ $tag->name }}
            </small></a>
            @endforeach()
        </div>
        <!--2nd comment scripts-->
        <div class="fb-comments" data-href="{{ Request::url() }}" data-width="" data-numposts="5"></div>

      </div>
    </div>
  </article>

  <hr>

@endsection()
@section('footer')
<script src="{{ asset('user/js/prism.js') }}"></script>
@endsection()

And this my layout file under themes directory

<!DOCTYPE html>
<html lang="en">

<head>
    @partial('head')

    @styles()
    
</head>

<body>
    @partial('header')

          @section('main-content')

          @show

    @partial('footer')

    @scripts('footer')
</body>

</html>

Issue with Direct asset path , Url should not start with /public

Issue with direct asset path , Url should not start with /public , resulting in 404 for assets.
Please suggest .

Input
<img src="{{ Theme::asset()->url('images/running-bnr.jpg') }}" alt="">
Output
<img src="/public/themes/default/assets/images/running-bnr.jpg" alt="">

Please also note : Adding assets through config is fine .

Input
$asset->themePath()->add([['style', 'css/style.css']]);
Output
<link media="all" type="text/css" rel="stylesheet" href="http://newps.in/themes/default/assets/css/style.css">

Config :

	'assetUrl' => env('APP_ASSET_URL', '/'),

	/*
	|--------------------------------------------------------------------------
	| Theme Default
	|--------------------------------------------------------------------------
	|
	| If you don't set a theme when using a "Theme" class 
	| the default theme will replace automatically.
	|
	*/

	'themeDefault' => env('APP_THEME', 'default'),

	/*
	|--------------------------------------------------------------------------
	| Layout Default
	|--------------------------------------------------------------------------
	|
	| If you don't set a layout when using a "Theme" class 
	| the default layout will replace automatically.
	|
	*/

	'layoutDefault' => env('APP_THEME_LAYOUT', 'layout'),

	/*
	|--------------------------------------------------------------------------
	| Path to lookup theme
	|--------------------------------------------------------------------------
	|
	| The root path contains themes collections.
	|
	*/

	'themeDir' => env('APP_THEME_DIR', 'public/themes'),

Sorry, this problem has occurred again.

php artisan theme:widget default

Illuminate\Contracts\Filesystem\FileNotFoundException : File does not exist at path
at /Users/teeoo/Desktop/VueBlog/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:41
37| if ($this->isFile($path)) {
38| return $lock ? $this->sharedGet($path) : file_get_contents($path);
39| }
40|

41| throw new FileNotFoundException("File does not exist at path {$path}");
42| }
43|
44| /**
45| * Get contents of a file with shared access.

Exception trace:

1 Illuminate\Filesystem\Filesystem::get()
/Users/teeoo/Desktop/VueBlog/vendor/facuz/laravel-themes/src/Commands/WidgetGeneratorCommand.php:192

2 Facuz\Theme\Commands\WidgetGeneratorCommand::getTemplate("widgetClass")
/Users/teeoo/Desktop/VueBlog/vendor/facuz/laravel-themes/src/Commands/WidgetGeneratorCommand.php:79

Please use the argument -v to see more details.

AssetContainer could not be converted to string

after migrate from teepluss\theme to FaCuZ/laravel-theme, in script

{!! Theme::asset()->container('footer')->usePath()->add('app', 'js/app.js') !!}

i get error:

"Object of class Facuz\Theme\AssetContainer could not be converted to string (View: D:\WWW\barlin\public\themes\default\views\landing.blade.php)"

then result in dd:

AssetContainer {#5927 ▼
  +usePath: true
  +path: null
  +name: "footer"
  +"assets": array:1 [▼
    "script" => array:1 [▼
      "app" => array:3 [▼
        "source" => "public/themes/default/assets/js/app.js"
        "dependencies" => []
        "attributes" => []
      ]
    ]
  ]
}

whats wrong this script?

in asset add "css/mystle/whatsapp.css?v=444" this source is considering as script.

IN AssetContainer.php

$type = (pathinfo($source, PATHINFO_EXTENSION) == 'css') ? 'style' : 'script';

This line is causing issue if i pass version in source.

Is there anyway to add versioning to asstes in Facuz.

Is there anyway i can achive versioning like below.
$asset->themePath()->add([
['style', 'css/style.css?v=6666666'],
['script', 'js/script.js?v=888888']
]);

Is Widget feature working???

Because someone noticed that we instantiate an abstract class Widget in ThemeServiceProvider.

I think thats not right.... Or i'am stupid??

Doesn't work with SeoTools

I have SEO Tools and im calling

$this->seo()->setTitle('My site title');

but the title doesn't update, i dont have any $theme->setTitle() in my code

Load another view

I have two views.
Example:
views
applications
create.blade.php
form.blade.php
How can I load form.blade.php in create.blade.php

My create.blade.php code is here

{!! Form::open(array('route' => 'restaurant.store','method'=>'POST')) !!}
    @include('restaurant.form');
{!! Form::close() !!}

This throws the following error.

View [restaurant.form] not found. (View: /var/www/works/public/themes/default/views/restaurant/form.blade.php)

Is there any ways to load another view.

php artisan theme:widget mdui default

Illuminate\Contracts\Filesystem\FileNotFoundException : File does not exist at path

at /Users/teeoo/Desktop/Teeoo/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:41
37| if ($this->isFile($path)) {
38| return $lock ? $this->sharedGet($path) : file_get_contents($path);
39| }
40|

41| throw new FileNotFoundException("File does not exist at path {$path}");
42| }
43|
44| /**
45| * Get contents of a file with shared access.

Exception trace:

1 Illuminate\Filesystem\Filesystem::get()
/Users/teeoo/Desktop/Teeoo/vendor/facuz/laravel-themes/src/Commands/WidgetGeneratorCommand.php:191

2 Facuz\Theme\Commands\WidgetGeneratorCommand::getTemplate("widgetClass")
/Users/teeoo/Desktop/Teeoo/vendor/facuz/laravel-themes/src/Commands/WidgetGeneratorCommand.php:79

Please use the argument -v to see more details.

Is there a way to delete a theme running Artisan command programmatically?

Hi,

I have a question.
Is there a way to delete a theme, running Artisan command programmatically?

Something like this:
Route::post('themes/destroy_theme/{theme}', ['as' => 'destroy_theme'], function () { Artisan::call('theme:destroy', ['name' => '{theme}']); return redirect('admin/themes/'); });

Regards,
Martin

Undefined index: content

I used this module to report the following error:

ErrorException (E_ERROR)
Undefined index: content (View: /home/www/lianghongbo-v2019/public/themes/default/layouts/layout.blade.php)
Previous exceptions
Undefined index: content (0)

How to solve this problem ?

Wok in Laravel 5.8?

Hello, i installed this package in Laravel 5.8 but not work for me, not detect Aliases Theme and with "use Facuz\Theme\Facades\Theme;" i get "Class theme does not exist". I can how fix? Thanks!

return with problem

hello any can help me?

this work correctly (direct in blade)
return view('index')->with('posts',$post)->with('recent_posts',$rcnt_post);

but with themes no work (with laravel-theme)
return Theme::view('index')->with('posts',$post)->with('recent_posts',$rcnt_post);

Question: multiple users

I want to use this package in a multiple users environment, where every user can select a different theme for his personal piece of website. Is this usecase supported, or is the global namespace variable an obstacle to that? I can't quite determine.

Thanks for your time!

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.