brucelampson / laravel-spark-camera
Profile photo camera support for Laravel Spark.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 8
Language:JavaScript
Type:package
pkg:composer/brucelampson/laravel-spark-camera
This package is auto-updated.
Last update: 2025-11-23 18:56:52 UTC
README
This package adds support for capturing images from your computer or phone camera.
Installation
-
Run
composer require eusebiu/laravel-spark-camera -
Add
Eusebiu\LaravelSparkCamera\CameraServiceProvider::classto yourprovidersarray inconfig/app.php -
Run
php artisan vendor:publish --provider="Eusebiu\LaravelSparkCamera\CameraServiceProvider" --tag=assets -
Edit
resources/views/vendor/spark/settings/profile/update-profile-photo.blade.php:- Add
@include('camera::camera-modal')right before closing the last div. - Add the Camera button
<button type="button" class="btn btn-primary" :disabled="form.busy" @click="openCamera">Camera</button>. - It should look like this.
- Add
-
Edit
resources/assets/js/spark-components/settings/profile/update-profile-photo.js:- Add
var camera = require('./update-profile-photo-camera');at the top. - Change the
mixinsoption tomixins: [base, camera].
- Add
-
Run
npm install --save webcamjs -
Run
npm run dev -
Edit
resources/sass/app.scssand add the following css#profile-photo-camera-preview, #profile-photo-camera-preview video { width: 100% !important; height: auto !important; min-width: 100px; min-height: 100px; }
This package uses WebcamJS, so if you want to configure it, overide the
configureWebcamjsmethod in yourupdate-profile-photo.jsfile.