Git Product home page Git Product logo

Comments (4)

michaelyue avatar michaelyue commented on May 30, 2024

I got the same issue with Laravel 8 in XAMPP in Windows 10

from laravel-pagebuilder.

michaelyue avatar michaelyue commented on May 30, 2024

I have encountered an error while installing Laravel-Pagebuilder.
My laravel version is 8

  > Illuminate\Foundation\ComposerScripts::postAutoloadDump

	@php artisan package:discover --ansi

TypeError

Argument 1 passed to PHPageBuilder\PHPageBuilder::__construct() must be of the type array, null given, called in C:\directory\laravel\vendor\hansschouten\laravel-pagebuilder\src\ServiceProvider.php on line 43

at C:\directory\laravel\vendor\hansschouten\phpagebuilder\src\PHPageBuilder.php:47
43? * PHPageBuilder constructor.
44? *
45? * @param array $config configuration in the format defined in config/config.example.php
46? */
? 47? public function __construct(array $config)
48? {
49? if (session_status() === PHP_SESSION_NONE) {
50? session_start();
51? }

1 C:\directory\laravel\vendor\hansschouten\laravel-pagebuilder\src\ServiceProvider.php:43
PHPageBuilder\PHPageBuilder::__construct()

2 C:\directory\laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:805
HansSchouten\LaravelPageBuilder\ServiceProvider::HansSchouten\LaravelPageBuilder{closure}(Object(Illuminate\Foundation\Application), [])
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Installation failed, reverting ./composer.json to its original content.

@josh-whit-me Did you find any solution?

from laravel-pagebuilder.

HansSchouten avatar HansSchouten commented on May 30, 2024

It seems like the configuration is not passed while instantiating the PHPageBuilder object over here https://github.com/HansSchouten/Laravel-Pagebuilder/blob/master/src/ServiceProvider.php#L43.

Can you have a look why config('pagebuilder') is empty? Did you publish the config using php artisan vendor:publish --provider="HansSchouten\LaravelPageBuilder\ServiceProvider" --tag=config.

from laravel-pagebuilder.

tykus avatar tykus commented on May 30, 2024

Same issue - this is happening on installation with composer, there is not opportunity to publish config.

I added a pagbuilder.php config file returning an empty array to change the error; which it did...

> @php artisan package:discover --ansi

   ErrorException

  Undefined index: SERVER_NAME

  at vendor/hansschouten/phpagebuilder/src/Core/helpers.php:247
    243▕         $port = '';
    244▕         if (isset($_SERVER['SERVER_PORT']) && ! in_array($_SERVER['SERVER_PORT'], [80, 443])) {
    245▕             $port = ":" . $_SERVER['SERVER_PORT'];
    246▕         }
  ➜ 247▕         $currentFullUrl = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . urldecode($_SERVER['REQUEST_URI']);
    248▕         $currentFullUrl = rtrim($currentFullUrl, '/' . DIRECTORY_SEPARATOR);
    249▕         return $currentFullUrl;
    250▕     }
    251▕ }

      +18 vendor frames
  19  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(HansSchouten\LaravelPageBuilder\ServiceProvider))

      +5 vendor frames
  25  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

from laravel-pagebuilder.

Related Issues (20)

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.