My problem is, I don't know how to install properly scotch-panels in Laravel project. I installed scotch-panels by:
npm install scotch-panels
and compile it by:
npm run dev
but I have error in console, when I used function from scotch-panels library:
Uncaught TypeError: $(...).scotchPanel is not a function
I tried extract module to vendor.js (like documentation said), but node states:
Module not found: Error: Can't resolve 'scotch-panels' in [...]
Unfortunately, link manually library it's not a option. I add that jQuery of course works properly.
I tried with other modules but once it's working, once not. I really don't know, what happened here.
Any help is highly appreciated with this, because I'm confused now.
Related
Looking for brilliant mind to help me fix my problem. I have inherited a Laravel v5.3 project, and the project should be able to pass CV's from html to .pdf. They have been using spatie/browsershot for that task. But for some reason the package won't write the damn file.
I have been looking at the html passed to the function, and it all checks out. So I went to the guide on Github and put this line of code into the codefile as the only one left in the function.
Browsershot::html('<h1>Hello world!!</h1>')->save('example.pdf');
No matter what I do, I get this error message:
Spatie \ Browsershot \ Exceptions \ CouldNotTakeBrowsershot
For some reason Chrome did not write a file at `example.pdf`.
I have also tried giving an absolute path for Browsershot to save the file at. But no matter. I have looked up many different guides the past two weeks, but nothing seems to work atm. Puppeteer is also installed locally.
I'm running a Windows 10 machine btw, with latest updates, if that matters.
I had the same issue in a PHP project. Installing the puppeteer package worked for me.
npm install puppeteer
After many comes and goes I managed to install the MongoDB Driver for PHP 5.6 and made it work on OSX El Capitan. (The way it worked was using Homebrew)
To start working on a project I created the folder for the project and using Composer installed the required packages I needed. Between theese packages I required mongodb/mongodb which is the recomended mongo php library to use by the php Manual on line and in the driver github page.
The problem I found is that Eclipse is resolving the classes in the \MongoDB\ namespace but not in the \MongoDB\BSON\ namespace. If I check what Composer installed in the vendor folder I am able to see that the \MongoDB\BSON\ classes in fact are missing. On the other hand if I run the program in the PHP included webserver, it executes as expected.
So my question is how can do or what am I missing for Eclipse to find the missing classes. Are they defined somewhere else?
If this is not possible because they are compiled into a binary library and I have no way to resolve them, Is there any way to have Eclipse not showing these particular classes as mistakes?
Example of class that runs ok in the webserver, but is highlighted as an error in Eclipse:
$fecha_creacion = new MongoDB\BSON\UTCDateTime();
Reading this post and not finding anything newer on the subject I arrived to the conclusion that developers of the driver don't provide the php sources and leave it to the IDE developers to provide STUBs for the different fuctions of the driver in a way the IDE can recognize the functions and provide syntax checking and documentations popups.
Following this question, I finally ended up finding a JetBrains GitHub where there are many different stubs for PHPStrom, this one among them.
So I copied the file and added it to my project as part of the sources. And that solved my problem.
How do I install modern PHP packages? I haven't used PHP for 5 years so everything seems new.
In particular I'm trying to install https://github.com/pda/pheanstalk. I downloaded the code, but when I try to
require_once 'Pheanstalk/Pheanstalk.php'
I get an error:
Fatal error: Interface 'Pheanstalk\PheanstalkInterface' not found
in /web/Pheanstalk/Pheanstalk.php
I found I should use use. When I try use Pheanstalk\Pheanstalk I get this error:
Fatal error: Class 'Pheanstalk\Pheanstalk' not found in /web/test.php on line 5
Can't I just download and use PHP code anymore like back in the day? How do I get these modern packages working? Packages seem to mention composer. Should I use that? Can't I just download code and use it? I don't want to depend on composer or any other package manager. I just want to run code.
The modern way of installing packages is to use Composer.
It might seem scary at first, but it isn't such a big deal.
You should also be able to download and use the package yourself, if the creator made that possible, it should be explained in the documentation however.
There might be no "easy" way to install your package without composer if the package creator intended it that way. For this package in particular, the only instructions are for Composer, so it's safe to assume that it's the easiest way to install it.
Of course it's possible to use his code directly, but you'll need to know what you're doing and understand namespaces.
Walked through the install steps over at http://www.php-maven.org/tags/2.0.0/php-lib-5min.html ...
Using: Maven 3.0.3,
PHP 5.3.13,
maven-php-plugin 2.0.0,
phpunit 3.6.10.
The project has only the stub LibraryClass.php and LibraryClassTest.php dropped in by the project builder call.
When i run 'mvn package' in the last step of their guide i'm getting:
Caused by: org.apache.xbean.recipe.MissingAccessorException: Unable to find a valid setter method: public void org.phpmaven.phpunit.impl.PhpunitSupport360.setSingleInvocation(...)
Looking at the javadoc for PhpunitSupport360, that method doesn't exist. As everything was installed by maven (and pear) i'm not sure what's going on. The guide says to user Maven v3.
Seems that it loads a wrong plugin. For me it works.
You shoud ensure that it really loads the correct plugin versions. If you try to change the php-maven plugin version (f.e. to 2.0-SNAPSHOT) you should use the corresponding php-parent-pom and use the property ${phpmaven.plugin.version} as version. or simply remove any version number from the php-maven plugins because the version numbers are managed by the php-parent-pom.
You may look at the output of mvn help:effective-pom to see what is going on and what versions for the plugins are used.
Recently started playing around with S2, amazing stuff! A while ago started an online Symfony2 Blog tutorial, however I got stuck on the page with Doctrine Data Fixtures generation,
Here is the message I'm getting when executing php app/console doctrine:fixtures:load in the console:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in C:\xampp\htdocs\blog-sf2\vendor\bundles\Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand.php on line 40
I am really stuck on it and I am running Windows 7, so can't really use deps file to pull dependencies from older versions (OR CAN I somehow??),
I've downloaded the newest versions of FixtureBundles and DoctrineFixtures.
Really appreciate any help on this one!
I think you need to read the installation documentation of this bundle for the 2.0 branch
You don't really "use the deps" file. The bin/vendors script uses it, and uses git. So what you need to do to "use the deps" is install git (and btw, install git-bash, you'll get a far better terminal).