Wanted to install Laravel-Excel (Maatwebsite) package manually without composer, but I dont know how.
Why? Because I have a laravel project in a free hosting server setup by other guy, and I can only access using Filezilla to edit/download/upload the codes.
If only Filezilla allow a command prompt that could use "composer update", then it will be easier.
Source laravel.io
I got solution! I cant use composer on my company because of secure network. But i can download zip form github and install it manual. The below is my example for HTMLPurifier :
This sentence will load all of file from vendor/mews/purifier/src and autoload in namespace Mews\\Purifier\\
'Mews\\Purifier\\' => array($vendorDir . '/mews/purifier/src'),
Sometime you need add library into autoload_namespaces.php intead of, please read in https://getcomposer.org/doc/04-schema.md#autoload
You got Mews\\Purifier\\Facades\\Purifier not found if public config before finish step 3
$ php artisan vendor:publish --provider="Mews\\Purifier\\PurifierServiceProvider"
This for composer history, providers and aliases will be load in config/app/php for register new provider
{
"name": "mews/purifier",
"version": "v2.0.12",
"type": "library",
"extra": {
"laravel": {
"providers": [
"Mews\\Purifier\\PurifierServiceProvider"
],
"aliases": {
"Purifier": "Mews\\Purifier\\Facades\\Purifier"
}
}
},
"autoload": {
"psr-4": {
"Mews\\Purifier\\": "src/"
}
}
},
Now you run this config, then vendor/mews/purifier/config will be move to config folder
$ php artisan vendor:publish --provider="Mews\\Purifier\\PurifierServiceProvider"
在本地下载包,然后上传包文件夹(在供应商下找到)以及更新的 composer.json
it's easy to do it by following this download the package and set the files in app folder
YourProject/app/Laravel-Excel/
and then add the path to composer.json in autoload
"autoload": {
...
"classmap": [
"database/seeds",
"database/factories"
"app/Laravel-Excel"
],
...
},
Run the composer dump-autoload
the solution refs to this question referance answer
Depending on how strict the server is, you could SSH into your Server. But doing it locally then uploading the required files is usually the way to go.
You might need to run composer autodump if you don't wipe the cache.
如果一切都在本地环境中运行,则将您的包和作曲家文件夹复制到位于供应商处的服务器
上传\\vendor\\maatwebsite copy \\vendor\\maatwebsite\\excel\\src\\config\\excel.php 到\\config\\excel.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.