All Questions
368
questions
44
votes
2
answers
24k
views
Using a non-laravel package on Laravel 4
Is it possible to include a package that was not specifically designed for L4 in the framework?
If so, how is it done? I know I need to add the package to my composer.json which adds it to the vendor ...
21
votes
7
answers
59k
views
Laravel league/flysystem getting file URL with AWS S3
I am trying to build a file management system in Laravel based on league/flysystem: https://github.com/thephpleague/flysystem
I am using the S3 adapter and I have it working to save the uploaded ...
17
votes
5
answers
32k
views
Cannot Install Laravel Package - Intervention Image
So I am following the tutorial on tuts+ Premium from Jeffrey Way - Creating an Ecommerce App in Laravel 4 and I am stuck with this problem. He is installing a package by just editing the composer.json ...
15
votes
1
answer
7k
views
How to access other input attributes in Validator::extend?
As the question title states:
How can you access other input attributes when using Validator::extend?
Upon inspecting Laravel's built-in Validator class, I can see it uses $this->data to access ...
14
votes
7
answers
51k
views
Laravel/Eloquent: Fatal error: Call to a member function connection() on a non-object
I'm building a package in Laravel 4 but am getting a non-object error when attempting to access the db from which seems to be a properly instantiated object. Here's the setup:
The config and class in ...
12
votes
3
answers
19k
views
When making a Laravel package, how do I register the service provider and alias of dependency packages?
I'm creating a package for Laravel and I've defined the Notification package (https://github.com/edvinaskrucas/notification) as a dependency for my package.
In /workbench/vendor/package/src/composer....
11
votes
1
answer
28k
views
How to generate laravel composer.json from a vendor directory? [duplicate]
In my Laravel project the composer.json and composer.lock files were deleted and I don't know how to rebuild the composer.json file from an existing vendor directory .
10
votes
2
answers
35k
views
barryvdh/laravel-dompdf page break content changes PDF
I am using this package barryvdh/laravel-dompdf is there any way to detect if content fits on the current page if not I want to put that content to the next page if it does not fit completly.
9
votes
5
answers
4k
views
How to add helpers in own laravel packages? (Call to undefined function)
In my composer.json I have written:
"autoload": {
"psr-4": {
"Pmochine\\MyOwnPackage\\": "src/"
},
"files": [
"src/helpers.php"
]
},
But somehow even after composer ...
7
votes
2
answers
1k
views
Laravel - Package can't recognise Auth functions?
I made a package which is counting the visitors on a webpage. Currently I have a single route, controller and view which don't do very much other than display a simple string. I have a separate ...
7
votes
1
answer
3k
views
Laravel use custom USER-Model in package
I´ve developed a package stored in LaravelRoot/packages/myname/project/ in Laravel.
Inside my package i´ll have to use an extended user-model containing a relationship not mentioned in the default ...
6
votes
8
answers
22k
views
Publishing config and migrations from included package in Laravel
I'm using Laravel to build a package which will include some Admin functionality and will include some other packages.
I have included a package which has migrations and a config file, But how do I ...
6
votes
2
answers
6k
views
Laravel package reading package config file and not published config file
I have created a Laravel package, uploaded it to packagist and managed to install it using composer require.
I have now hit a problem and I don't know how to fix it and doing a search does not help.
...
6
votes
1
answer
4k
views
Laravel error Uncaught exception 'ReflectionException' with message 'Class App\Http\Kernel does not exist'
When I wanted to add form in my laravel 5.2 project I got some errors in composer.
After that My whole project got a strange error bellow :
Fatal error: Uncaught exception 'ReflectionException' ...
6
votes
1
answer
2k
views
Using other packages inside my laravel package [closed]
I created a package with the artisan workbench command.
Everything works fine, but I want to use another composer package inside my package.
What's the best/cleanest way to do that?
6
votes
1
answer
2k
views
Run Laravel Seeder From Package
I'm working on a package for an internal Laravel application and I'm having trouble running a seeder that exists in the package directory.
In my package's composer.json file located in packages/vendor/...
5
votes
3
answers
7k
views
Using models on packages
I'm trying to use Laravel packages. I created MyVendor/MyPackage
Routes, controllers, filters are already working. This is the classmap of my package:
"classmap": [
"src/...
4
votes
2
answers
7k
views
How to override a Laravel package function
I'm using https://github.com/artesaos/seotools package for seo.
I am trying to override getCanonical function located at https://github.com/artesaos/seotools/blob/master/src/SEOTools/SEOMeta.php and ...
4
votes
1
answer
12k
views
Creating a new ServiceProvider / Facade as a package in Laravel 5
Introduction
I've never worked with a framework before (Zend, CakePHP, etc) and finally decided to sit down and learn one. I'm starting with Laravel because the code looks pretty and unlike some ...
4
votes
2
answers
239
views
How to make vendor package classes being extendable with PSR-4 autoloading?
I'm using Laravel as framework to build an application framework which can be used to build their own application by fellow developers.
Now I'm running into a little PSR-4 namespacing problem in the ...
4
votes
1
answer
2k
views
Laravel package session variable not saving with ajax call
I'm building a package called under-construction. When this package is activated in a config
file the site will be underconstruction only people with the right code can access the
application.
...
4
votes
2
answers
1k
views
Composer Packagist. How to define a package as stable?
Im new to making packages with composer.
I am currently creating a package for laravel.
My question is basically, how do I define a package as stable. Because at the moment I am unable to require ...
4
votes
2
answers
4k
views
Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found Laravel passport
Hello everyone i'm using sfelix-martins/passport-multiauth Based on laravel passport
I'm getting this error
{message: "Class 'Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found",…}
...
4
votes
2
answers
1k
views
Laravel controllers and routes in packages?
I'm having trouble registering controllers to routes in my package.
As far as I understand from the official documentation I just need to simply prefix it and use my namespace though I always get the ...
4
votes
2
answers
6k
views
Laravel merging configs in Laravel packages
I'm writing a package on laravel that it require some packages to install.
I want to overwrite own package configuration file with the applications's published copy, and use the mergeConfigFrom ...
3
votes
2
answers
4k
views
Setting up Integration tests in a laravel package
Currently struggling to setup integration tests within a package I'm writing.
For the integrations tests I will need to have access to a Laravel environment so I can access things such as Artisan::...
3
votes
1
answer
17k
views
How do I pass a parameter to a controller action within a Laravel Package?
Within a Laravel package I made, I want to redirect the user to a controller action that requires a parameter (within the same package).
Controller:
public function postMatchItem(Request $request, $...
3
votes
1
answer
17k
views
Class 'Composer\InstalledVersions' not found
I am working on a laravel based project.
Like everyday, I am trying to hit this command to run my project on server: php artisan serve
But I am getting this error:
Class 'Composer\InstalledVersions' ...
3
votes
1
answer
2k
views
Facades vs. Classes with static methods in Laravel
I was looking around the Laravel framework and some of their products and I noticed that Cashier is using the Casheir class with static methods compared to Socialite, which is used as a facade.
What ...
3
votes
1
answer
4k
views
use package's config files in laravel 5
I have a laravel 5 package based application.In the package this is my structure:
Packages
-vendor
-xxx
-public
-src
-config
...
3
votes
1
answer
3k
views
Create custom package with facade in Laravel 8
I am trying to develop a new Laravel package locally installed via Composer.
These are my steps:
I install a new Laravel application with composer create-project laravel/laravel my-application
I ...
3
votes
1
answer
4k
views
Requiring a npm package in laravel mix?
I've seen this question being answered a couple of times on the net. However, I'm just not getting it to work. I hope you can help.
I'm using Laravel 5.5 with Laravel Mix. Instead of manually loading ...
3
votes
1
answer
2k
views
How to use Laravel package in my own package?
I'm developing a Role-Permission package in Laravel and I want to use this package;
Laravel permission github
Problem is I can not use some functions in the main project when I install this package ...
3
votes
1
answer
403
views
Dynamic model namespace in laravel lumen package
I am building a laravel lumen package. In the package there is a service provider which uses instance of User model in a function. I used App\User as namespace there.
Now,
If actual User Model is ...
3
votes
1
answer
611
views
Laravel 5 package development: where to start? [closed]
Whilst creating this question, Stackoverflow already said this is a subjective question I'm asking. However, I think this is a question many starting (package) developers asked themselves at some ...
3
votes
1
answer
262
views
laravel 4 workbench routing to the package
I have been working with laravel 4 for some time now and i needed to create an admin area so i decided to use a package to keep things all organized and separated from the rest of the application.
So ...
3
votes
0
answers
1k
views
how to use barryvdh/laravel-snappy package in live server cpanel
guys iam working with a project. it was running in live. everything works fine.
now i need charts and graphs as report, so i installed barryvdh/laravel-snappy package in my local.
what i did is for ...
3
votes
0
answers
445
views
How to mock pass-by-reference parameter using laravel Facade?
I'm making a simple laravel package to wrap bash executions and make it be able to mock as laravel facade, but I have a problem.
Most of Php functions that runs bash commands uses pass-by-reference ...
3
votes
0
answers
895
views
Laravel Package with dependency package
I am developing laravel package. Here is my composer.json file. in my local package, i am adding opentok/opentok dependency package. So after running composer, vendor folder created in my local ...
3
votes
0
answers
196
views
Composer fails when installing a dependency of a dependency, but not when the dependency is installed directly
I have a main composer.json that has the following among others
"type": "project",
"repositories": [
{
"type": "path",
"url": "../packages/example/example/",
"options": {
...
3
votes
0
answers
2k
views
Modular model relationship traits for laravel eloquent models
I'm separating my code into small packages, utilizing the benefits of reusing these packages for other applications I'll come to development. (Package Development)
Example Packages List:
UserPackage ...
3
votes
0
answers
65
views
Laravel vendor:publish adds random text to the published files
I'm building a package and I'm publishing a folder with CSS and JavaScript files to the host project. Using the following code
$this->publishes([__DIR__ . '/../../public' => public_path('vendor/...
2
votes
2
answers
1k
views
use config file of custom package without publishing in Laravel 5.*
I have a config file for my Laravel Custom package.
Currently I am using custom package's config file by publishing it as mentioned in the docs.
I just want to clarify that, Is there a way to use ...
2
votes
3
answers
9k
views
Remove package from Laravel
I executed these 2 commands:
composer require realrashid/sweet-alert
composer require infinety/alerts *@dev
They are packages to use SweetAlert on Laravel but they are not working and I found a ...
2
votes
4
answers
3k
views
Problems with Vendor:Publish in laravel 5
I downloaded a package with composer. In this case the package is Riari Forum-Laravel. When I run php artisan vendor:publish, it says there is nothing to publish and I don't know why.
2
votes
2
answers
4k
views
Extend Laravel validator multiple times
Similar to the confirmation rule, I'm creating a validation rule that's based on the value of another attribute. From what I've found the only way to accomplish this is by extending the Validator ...
2
votes
1
answer
5k
views
How to override Laravel's language files with your package language
I am trying to override the default laravel english language package under resources/lang/enwith my languages from my package.
The package just publishes its own language files to e.g. resources/lang/...
2
votes
2
answers
12k
views
Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given
I try to sign up by Facebook, using Laravel 7 and package (Socialite), when press on the URL:
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
...
2
votes
2
answers
588
views
How can I send multiple notification with "minishlink/web-push" pakckage?
I am using "minishlink/web-push" package to send notification in my Laravel project.
Route::post("/admin/sendNotif/{sub}", function(PushSubscription $sub, Request $request){
$...
2
votes
1
answer
1k
views
How to install the latest version of a package using composer in the command line?
i'm trying to install the latest version of cviebrock/eloquent-sluggable that is compatible with laravel 5, i believe this is the 3.0.0-alpha / dev-master version.
however when i run composer require ...