Class not found error when attempting to publish kyslik/column-sortable package - laravel-9

When i attempt to publish kyslik/column-sortable package with the command
php artisan vendor:publish --provider="KyslikColumnSortableColumnSortableServiceProvider" --tag="config"
I get the error
In ProviderRepository.php line 208:
Class "KyslikColumnSortableColumnSortableServiceProvider" not found
following instructions from https://meritocracy.is/blog/2020/04/17/laravel-using-pagination-sorting-and-filtering-with-your-tables/

I ran into the same issue when following those instructions. It looks like there's a typo in two parts.
In config/app.php there needs to be some back slashes to properly identify the provider class. Use this instead:
Kyslik\ColumnSortable\ColumnSortableServiceProvider::class,
And same thing when running the php artisan command:
php artisan vendor:publish --provider="Kyslik\ColumnSortable\ColumnSortableServiceProvider" --tag="config"
That fixed the issue for me. I haven't made it further in the instructions yet to see if anything else needs to be adjsuted. I found the correct commands on these instructions: https://www.laravelia.com/post/laravel-9-table-sorting-example-with-pagination

Related

BadMethodCallException Method Illuminate\Translation\Translator::getFromJson does not exist

BadMethodCallException
Method Illuminate\Translation\Translator::getFromJson does not exist.
Bad Method Call
Did you mean Illuminate\Translation\Translator::getLine() ?
I have tried by given command but it's not working for me. same error
is showing.
php artisan view:clear
php artisan view:cache
also tried by these :
php artisan config:cache
php artisan config:clear
php artisan route:clear
I have also deleted cache files from bootstrap/cache
** BUT till now It's Not Working :( **
Laravel 6+ replaced Translator getFromJson() to just get(). If you find and replace all instances that should fix the issue.

orocommerce install failed you have requested a non-existent parameter "web_backend_prefix"

I done all steps to install orocommerce on azure CentOS and nginx.
So now i got the following error after
$ ./bin/console oro:install --env=prod --timeout=900
"In ParameterBag.php line 102:
You have requested a non-existent parameter "web_backend_prefix".
Have anybody an idea?
How exactly did you get the source code (if GitHub - what repository, tag/branch, if download - what website and version)? Based on the error text it seems like it might be OroPlatform or OroCRM application, not OroCommerce.

How to install gulp via NPM?

Following this tutorial to set up app. It seems pretty normal and standard compared to all of the other tutorials that I have found. However, when tried and complete the 1.2.3 step Create a gulpfile.js at the root of the project: I am getting this error
error syntax error near unexpected token `}'
This is the command used in terminal.
var gulp = require('gulp');
Basically all want to do is download gulp so, can run sass with my css in atom. Any help?
You're right. The code wasn't for the terminal. I needed to create the file separately. I misread the tutorial. Thanks for the help!

Fatal error: Class 'PHPUnit_Extensions_Selenium2TestCase' not found in *.php

I am completely new to Seleniu, and am trying to set up PHPUnit with Selenium 2, following this tutorial https://www.youtube.com/watch?v=zva_GETXimI
So far this is what I've done:
Installed PHPUnit using PHAR as instructed here https://phpunit.de/manual/current/en/installation.html
Installed Selenium Server
Upgraded to PHP5.6 (but my Apache is still 2.22 instead of 2.4)
Installed PHPUnit_selenium package using Composer
Created a testLogin.php file:
<?php
class testLogin extends PHPUnit_Extensions_Selenium2TestCase{
public function setUp()
{
$this->setHost('localhost');
$this->setPort(4444);
$this->setBrowser('firefox');
$this->setBrowserUrl('http://localhost/Achievers');
}
}
When I run testLogin.php using 'phpunit testLogin.php' I get an error:
Class 'PHPUnit_Extensions_Selenium2TestCase' not found in /home/osadmin/projects/Sel/testLogin.php on line 5
Since I am just starting out, I have no idea how to fix this. On googling the error, it shows to add this line to my php file:
require_once('PHPUnit/Extensions/Selenium2TestCase.php');
But I'm not sure how I can use this since there is no PHPUnit folder, just a file linked to the PHAR.
Could someone please shed some light on how to fix this issue?
Thanks.
EDIT:
As per Ushakov's suggestion, I tried /path/to/phpunit.phar testLogin.php
But it gives the same error.
If I add this line to the testLogin.php: require_once('/usr/local/bin/phpunit');
and run /path/to/phpunit.phar testLogin.php
I get this:
#!/usr/bin/env php
PHP Notice: Constant __PHPUNIT_PHAR__ already defined in /usr/local/bin/phpunit on line 18
PHP Notice: Constant __PHPUNIT_PHAR_ROOT__ already defined in /usr/local/bin/phpunit on line 19
PHP Fatal error: Cannot redeclare class DeepCopy\DeepCopy in phar:///usr/local/bin/phpunit/myclabs-deep-copy/DeepCopy/DeepCopy.php on line 15
Solved it by adding this line to the PHP file:
require_once 'vendor/autoload.php';
No tutorial I have seen mentions this, but it can be found in github projects
For anyone else coming late to the party - this worked for me:
class testLogin extends \PHPUnit\Extensions\Selenium2TestCase
(Using PHP 7.0.3 and installing Selenium package with Composer ).

casperjs.bat on windows fails with cannot find module cli.js error

I'm trying out casperJS to run some automated tests. On windows. I followed this installation guide but am stuck.
when I try to run a simple test from the command line like this:
casperjs.bat smoketest.js
I get the following error:
Error: Cannot find module 'C:/code/base/main/Shared/casperjs\modules\cli.js'
I checked, and the file cli.js does exist under the specified path.
I thought the problem could be the mixture of forward and backward slashes in the path, but I edited the bootstrap.js casper code to hard code the path and it made no difference - it still the cannot find module.
I'm have tried this using phantomJS version 1.9.0, and 1.8.2.
Anyone know what I am doing wrong?
Has anyone had success running casper on Windows?
This is due to a bug in PhantomJS 1.9.0 that does not allow for absolute path loading in Windows. Afaik, this should only be apparent if you are using a master build of CasperJS (v1.1).
This bug has been fixed, but is not yet in the Windows binary. You can compile it yourself if you'd like, but that can take quite a bit of time.
I was using the master build of casper. With the latest released version, 1.0.2, it works fine.