PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label voyager. Show all posts
Showing posts with label voyager. Show all posts

Wednesday, February 9, 2022

[FIXED] Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted Voyager

 February 09, 2022     composer-php, laravel, php, voyager     No comments   

Issue

Hi, I am trying solve some problem when I am install voyager. When I try to run composer require I am getting the out of memory error. I am not understand what exably happend. Its result on my console:

@DESKTOP->>>>> /c/xampp/htdocs/ (master) $ composer require tcg/voyager Using version ^1.4 for tcg/voyager ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 134217736 bytes) in phar://C:/composer/composer.phar/src/Composer/DependencyResolver/RuleSet.php on line 83```

Maybe there's a problem with the composer.JSON, something I need to check out. What you should pay attention to what is the problem My composer.json file``` {

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
    "framework",
    "laravel"
],
"license": "MIT",
"require": {
    "php": "^7.2",
    "convertapi/convertapi-php": "^1.1",
    "fideloper/proxy": "^4.0",
    "laravel/framework": "^6.2",
    "laravel/socialite": "^4.3",
    "laravel/tinker": "^1.0",
    "openpayu/openpayu": "^2.2",
    "paypal/rest-api-sdk-php": "^1.14",
    "pragmarx/tracker": "^3.5",
    "spatie/laravel-backup": "^6.8",
    "spatie/pdf-to-image": "^2.0",
    "tcg/voyager": "^1.3"
},
"require-dev": {
    "facade/ignition": "^1.4",
    "fzaninotto/faker": "^1.4",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^3.0",
    "phpunit/phpunit": "^8.0",
    "tanmuhittin/laravel-google-translate": "^1.0"
},
"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
},
"extra": {
    "laravel": {
        "dont-discover": []
    }
},
"autoload": {
    "psr-4": {
        "App\\": "app/"
    },
    "files": [
        "app/Helpers/HelperFunctions.php"
    ],
    "classmap": [
        "database/seeds",
        "database/factories"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi"
    ],
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate --ansi"
    ]
},
"repositories": {
    "hooks": {
        "type": "composer",
        "url": "https://larapack.io"
    }
}

}


Solution

Looks like you are using xampp. you can try to change the memory_limit in php.ini. enter image description here

Find this:

;memory_limit=512M 

Change to :

memory_limit =-1

Then restart the Apache from xampp



Answered By - Andy Song
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, January 26, 2022

[FIXED] Laravel - SQLSTATE[42S02]: Base table or view not found: 1146 Table

 January 26, 2022     laravel, laravel-5.5, php, voyager     No comments   

Issue

I'm setup homestead in my pc then i'm try to access my files via local domain. But when i'm trying to connect with DB then showing me this error. I can't access my others projects too. I setup everything very well. But i don't know why showing me this error.

Note: I'm using windows 8.1

Here is my setup code:

  1. Homestead.yaml

ip: "192.168.10.10"

memory: 2048

cpus: 1

provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:

- ~/.ssh/id_rsa

folders:

- map: F:/xampp/htdocs/Projects
  to: /home/vagrant/Projects

sites:

- map: govt-university.dev
  to: /home/vagrant/Projects/govt-university/public

- map: voyager.dev
  to: /home/vagrant/Projects/voyager/public

- map: evaluationplus.dev
  to: /home/vagrant/Projects/laravel-evaluationplus/public

- map: laravel-university.dev
  to: /home/vagrant/Projects/laravel-evaluationplus/public

databases: - homestead


  1. Host file

    192.168.10.10 govt-university.dev
    
    192.168.10.10 voyager.dev
    
    192.168.10.10 evaluationplus.dev
    
    192.168.10.10 laravel-university.dev
    

  1. ENV file

    APP_NAME= Laravel

    APP_ENV=local

    APP_KEY=base64:nmcR0V2cbq+26H3EBdLmYRQN5bkiOryROTxHpvUzuvA=

    APP_DEBUG=true

    APP_LOG_LEVEL=debug

    APP_URL=http://voyager.dev

    DB_CONNECTION=mysql

    DB_HOST=127.0.0.1

    DB_PORT=3306

    DB_DATABASE=voyager

    DB_USERNAME=homestead

    DB_PASSWORD=secret


Error Image: enter image description here

Please help me to solve this problem. Thanks


Solution

You need to ssh into Vagrant and then run artisan command to migrate database. Once you do this will be fixed.



Answered By - Manzurul
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, January 19, 2022

[FIXED] How to use font awesome inside laravel Voyager?

 January 19, 2022     font-awesome, fonts, laravel, voyager     No comments   

Issue

is it possible to use font awesome in laravel voyager? If so how do I go about using it?


Solution

You can do that by adding your css from config/voyager.php in additional_css

Install Font Awesome using npm i @fortawesome/fontawesome-free --save-dev

Create laravel mix file resources\sass\font-awesome.scss and import fontawesome file in that mix

//Font Awesome

@import '~@fortawesome/fontawesome-free/scss/fontawesome';

@import '~@fortawesome/fontawesome-free/scss/solid';

@import '~@fortawesome/fontawesome-free/scss/regular';

@import '~@fortawesome/fontawesome-free/scss/brands';

In webpack.mix.js

mix.js('resources/js/app.js', 'public/js')

    .sass('resources/sass/app.scss', 'public/css')

    .sass('resources/sass/font-awesome.scss', 'public/css');

npm run dev compile css file using this command for dev environment

config\voyager.php

'additional_css' => [

    'css/font-awesome.css',

],


Answered By - Apurv Bhavsar
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, January 10, 2022

[FIXED] Composer failure when installing Laravel 5.8 + Voyager

 January 10, 2022     composer-php, laravel, laravel-5.8, voyager     No comments   

Issue

I installed laravel 5.8, and then i did composer require tcg/voyager:1.3.2. I didn't used composer require tcg/voyager cause apparently it doesn't supports laravel 5.8. However it keeps failling and throwing this problem:

Problem 1
    - Can only install one of: league/flysystem[1.1.3, 1.0.x-dev].
    - Can only install one of: league/flysystem[1.0.x-dev, 1.1.3].
    - Can only install one of: league/flysystem[1.0.x-dev, 1.1.3].
    - tcg/voyager v1.3.2 requires league/flysystem ~1.0.41 -> satisfiable by league/flysystem[1.0.x-dev].
    - Installation request for tcg/voyager 1.3.2 -> satisfiable by tcg/voyager[v1.3.2].
    - Installation request for league/flysystem 1.1.3 -> satisfiable by league/flysystem[1.1.3].

I tried first installing composer require league/flysystem:1.1.3 before voyager but still it fails with the same error. Am at the lost here.


Solution

Have you checked whether league/flysystem has been installed before? According to that error message it is installed in v1.1.3, while tcg/voyager requires v1.0.* - this is not compatible.

v1.1 of the flysystem is pretty new, and only the current dev branches of Voyager contain fixes for this.

To resolve this situation, you could run composer require league/flysystem:"~1.0.41"



Answered By - Nico Haase
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, January 4, 2022

[FIXED] Issue installing composer package for Laravel, Voyager 1.4

 January 04, 2022     composer-php, laravel, php, voyager     No comments   

Issue

I am still sort of a newbie with Laravel, and I want to install the Voyager admin panel in an existing Laravel app that is not too far along yet in development. The GitHub for Voyager is here:

Voyager Laravel Admin

The CLI is:

sscotti@iMac-Catalina PortalRads % composer require tcg/voyager
Using version ^1.4 for tcg/voyager
./composer.json has been updated
Running composer update tcg/voyager
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - tcg/voyager[1.4.x-dev, ..., 1.x-dev] require doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ..., 2.13.x-dev] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - tcg/voyager[v1.4.0, ..., v1.4.2] require illuminate/support ~6.0|~7.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires tcg/voyager ^1.4 -> satisfiable by tcg/voyager[v1.4.0, ..., 1.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Before I mess around with it too much, wanted to see what the proper way is to upgrade or adjust my packages to work with that.

The composer.json is kind of big, but the most important part is probably:

"require": {
    "php": "^7.3|^8.0",
    "aranyasen/hl7": "^2.0",
    "aws/aws-sdk-php": "^3.163",
    "barryvdh/laravel-snappy": "^0.4.8",
    "bower-asset/bootstrap": "~4.5",
    "bower-asset/dropzone": "^5.7",
    "bower-asset/font-awesome": "~5.14",
    "bower-asset/jquery": "^3.5.1",
    "bower-asset/jquery-migrate": "~3.0",
    "bower-asset/jquery-timepicker-jt": "~1.13",
    "bower-asset/jquery-ui": "~1.12",
    "bower-asset/jquery-validation": "~1.19",
    "bower-asset/moment": "^2.29",
    "bower-asset/moment-timezone": "^0.5.31",
    "bower-asset/pdfjs-dist": "~2.6.347",
    "bower-asset/plupload": "~3.1.2",
    "bower-asset/sumoselect": "~3.0",
    "fideloper/proxy": "^4.2",
    "fruitcake/laravel-cors": "^2.0",
    "fzaninotto/faker": "^1.5",
    "google/recaptcha": "^1.2",
    "guzzlehttp/guzzle": "^7.0.1",
    "intervention/image": "^2.5",
    "jenssegers/agent": "^2.6",
    "laracademy/generators": "^3.0",
    "laravel/framework": "^8.0",
    "laravel/jetstream": "^2.2",
    "laravel/sanctum": "^2.6",
    "laravel/tinker": "^2.0",
    "league/oauth2-google": "^3.0",
    "livewire/livewire": "^2.4",
    "nesbot/carbon": "^2.42",
    "oomphinc/composer-installers-extender": "2.0",
    "phpmailer/phpmailer": "^6.1",
    "rbdwllr/reallysimplejwt": "^4.0",
    "spatie/laravel-cookie-consent": "^2.12",
    "spatie/laravel-csp": "^2.6",
    "spatie/laravel-permission": "^4.0",
    "yajra/laravel-datatables-oracle": "^9.15"

I did not try the --with-all-dependencies option, and I am not sure if there is a 'dry-run' option for composer.

There are special instructions for installing over an existing Laravel app, but I need to get the package to install first. See: Install for Existing App


Solution

  Problem 1
    - tcg/voyager[1.4.x-dev, ..., 1.x-dev] require doctrine/dbal ^2.5 -> found doctrine/dbal[v2.5.0-BETA2, ..., 2.13.x-dev] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - tcg/voyager[v1.4.0, ..., v1.4.2] require illuminate/support ~6.0|~7.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires tcg/voyager ^1.4 -> satisfiable by tcg/voyager[v1.4.0, ..., 1.x-dev].

The important parts are given in line 2: you are using Laravel v8, but tcg/voyager is not compatible with that. There are multiple bug tickets in their repository about this, but until this is fixed, you either have to downgrade Laravel or resign from using Voyager



Answered By - Nico Haase
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing