I have developed my project laravel 5.0 but, I want to install the package for Data-tables. I have tried this package with below-mentioned versions.
composer require yajra/laravel-datatables-oracle:^6.0
composer require yajra/laravel-datatables-oracle:~5.0
"yajra/laravel-datatables-oracle": "^6.6.0",
composer require yajra/laravel-datatables-oracle:~6.0
This package is not installing in my project. Please suggest me any other package for Datatables Laravel 5.
I think you need to do is to add the following in your composer.json file:
"require": {
"yajra/laravel-datatables-oracle": "~6.0"
}
after run composer update command in cmd
Hope this work for you!
Related
I have installed the s3 flysystem package by running the following composer command in my Laravel 8 project
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"
and tried to store a file from the request as
$imageName = $request->file('file')->store('uploads');
I got the following error
League\Flysystem\AwsS3v3\AwsS3Adapter::__construct(): Argument #1
($client) must be of type Aws\S3Client, Aws\S3\S3Client given, called
in
D:\Projects\Rescale\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemManager.php
on line 229
So it seems ThePHPLeague Flysystem major version got updated (to v2) thus breaking a lot of stuff since latest Laravel depends on "^1.1" (see: https://github.com/laravel/framework/blob/8.x/composer.json#L27).
I've had this error, so my workaround is to use a specific version instead.
Go to composer.json and use latest v1 (see: https://github.com/thephpleague/flysystem-aws-s3-v3/tags).
- "league/flysystem-aws-s3-v3": "^1.0",
+ "league/flysystem-aws-s3-v3": "1.0.29",
Run composer update and let composer update your dependencies.
try this to upload an image on AWS
$path = Storage::disk('s3')->put('uploads', $request->file('file'));
try this
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "~1.0"
I got same error in Laravel version 8
open composer.json and change inside version to "league/flysystem-aws-s3-v3": "^1.0"
run composer update
Is there an artisan command or other? I am new to Laravel hence the basic question - just looking for some direction with that please.
Seems like it's a mix of automation and testing.
Henry
Composer.json
"require": {
"laravel/framework": "5.8.*",(your deisre version)
},
composer install
I got this requirement in my composer.json:
"php": ">= 5.6",
"symfony/http-foundation": "^3.0"
The problem with that configuration is that it will install paragonie/random_compat v9.99.99 which is only compatible with PHP 7 and more. But the thing is that I don't want my composer.lock file to require PHP 7, I want it to still be compatible with PHP 5.6.
The solution I found is to track down which package was pulling this dependency and, once I found it, I added this to my requirements:
"paragonie/random_compat": "~2.0"
But I wonder if there is not a better way of doing that: somehow telling that I accept all the versions above PHP 5.6, but I don't accept packages that would force to have PHP 7?
If you want to make composer.lock compatible with PHP 5.6, you have at least two options to achieve that:
Use PHP 5.6 for composer update - you should be able to install multiple versions of PHP on your OS and run Composer like this:
/path/to/php6.5 /path/to/composer update
Use platform settings in composer.json to force installation for specific version regardless PHP version used to run Composer commands:
"config": {
"platform": {
"php": "5.6.38"
}
},
Installed laravel 5.6
Have PHP 7.0 installed as well.
When I try
laravel new sample-project
it creates the required files and dependencies but bails with an error below:
PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/johndoe/laravel/sample-project/vendor/symfony/console/Output/Output.php on line 40
Have a feeling this might be due to issues with the symfony file but not sure how to go about getting the right version or making a change in Output.php
Trying any other command such as
php artisan list
results in the same error
Composer relevant section denoting laravel 5.6 / php 7.1.3
"require": {
"php": "^7.1.3",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "~1.0"
},
Any help would be appreciated.
EDIT
Based on the answer I had to create a project with laravel version 5.5 which means I had to use
composer create-project laravel/laravel sample-project "5.5.*"
That worked.
Laravel 5.6 requires PHP > 7.1.3
you will need to make sure your server meets the following
requirements:
PHP >= 7.1.3
I ended up having to edit the $PATH in my .bashrc file, because it was picking up an old version of php.
> whereis php
> echo $PATH
I found the correct version of php here: /opt/php71/bin
So now my .bashrc file looks like this:
export PATH=/opt/php71/bin:$PATH
This fixed the error I was getting in composer, AND now php artisan also works!
:-D
PS. The version of php that you're using in the shell may be different from the version used to serve your site. That can be fixed in cpanel's php selector.
After installing Composer, I then went to c:\xampp\htdocs and executed the following command:
composer create-project laravel/laravel khandakhulu --prefer-dist
I then get the following error:
[Composer\Repository\RepositorySecurityException] The contents of http://packagist.org/p/laravel/laravel$a996426ffd2d6fcd0d9a 2dfdd97171b28b3d196d34061f15d79ce67004b9c19d.json do not match its signatur e. This should indicate a man-in-the-middle attack. Try running composer ag ain and report this if you think it is a mistake.
Basically we need to force the composer use https repository at composer.json as we know from Laravel.io Forum
But we don't have any skeleton of laravel project. So, use Laravel Installer instead. This global installation generate composer.json at ~/.composer/composer.json and modify to this
{
"require": {
"laravel/installer": "~1.1"
},
"repositories": {
"packagist": { "url": "https://packagist.org", "type": "composer" }
}
}
First time installation of Laravel Installer maybe will get same error, after you force the respository URL. Finally, create your new Laravel application.
~/.composer/vendor/bin/laravel -v new justapp