spatie

Assigning the role while user registration

*爱你&永不变心* 提交于 2021-02-11 14:49:19
问题 I am working in laravel and i am using the spatie permission package and I want to assign the different role for the user while registration I am using the radio button to get the role from a user such as editor ,writer,blogger how to I assign the different role to user based on the user input 回答1: In Laravel Auth\RegisterController you can modify the create() function. This is valid if you are using Spatie package. protected function create(array $data) { $user = User::create([ 'name' =>

Syntax error near unexpected token `newline' in cPanel

孤人 提交于 2021-01-29 20:08:07
问题 I am trying to back up my database in Laravel using Spatie package. Every thing worked fine till 31 Decemeber 2020 and in New Year my cron job stoped working. I don't know what happened, but on my cPanel mail I am receiving this email: /usr/local/cpanel/bin/jailshell: -c: line 0: syntax error near unexpected token `newline' /usr/local/cpanel/bin/jailshell: -c: line 0: `/usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> ' and this is the cron job I am applying: /usr/local

Running artisan command from controller or route

帅比萌擦擦* 提交于 2020-12-31 05:59:33
问题 I use Spatie Laravel package I can take backup by running this command php artisan backup:run but I want to take back up form admin panel and running this command form controller, I create a route and controller and in the controller, I do this public function backup(){ \Artisan::call('backup:run'); return "successfully!"; } when I route to this finally I got the success message but in the backup file, nothing added. 回答1: You can put artisan command in sheduler. It will make back up for

How do I get View ID from Google Analytics 4?

若如初见. 提交于 2020-12-09 06:38:47
问题 I tried to retrieve all information about my website from GA (Google Analytics). I'm using laravel and this package https://github.com/spatie/laravel-analytics to make my life easier. However, that package requires "View ID" from GA, which I can't help myself to find it. I read this thread https://support.google.com/analytics/thread/15684521?hl=en and I'm guessing that since GA 4 they totally removed the views column from Web + App property (which will be created as a default) (correct me pls

how to resolve an error to use spatie laravel

99封情书 提交于 2020-06-29 04:08:25
问题 I am using spatie library in laravel lumen to create file into image. But it is giving error. $destinationPath = storage_path('uploads'); $new_path = str_replace('\\', '/', $destinationPath); Browsershot::url('https://www.example.com/') ->setScreenshotType('jpeg', 100) ->save($new_path); Error is: The given path 'your storage file path' did not contain an extension. Please append an extension. 来源: https://stackoverflow.com/questions/62302857/how-to-resolve-an-error-to-use-spatie-laravel

Spatie/Laravel-medialibrary can't retrieven file from Backblaze Storage: This driver does not support retrieving URLs

会有一股神秘感。 提交于 2020-06-17 02:18:19
问题 I am using spatie/laravel-medialibrary:8.2 package on my laravel 7.6 project. I am going to store media data on Backblaze Cloud Storage using gliterd/laravel-backblaze-b2 package. I made file driver called media as following and using it in media-library.php as file driver. When I uploaded file, it stored on exact directory what I wanted. But when I was going to retrieve it, I got following error. This driver does not support retrieving URLs Media-library package doesn't support for B2

Using Cloudinary with spatie/media-library Laravel package

a 夏天 提交于 2020-03-22 07:44:49
问题 Is anyone using Laravel package spatie/media-library with Cloudinary? I thought implementing it would be trivial with flysystem. I'm actually using Cloudinary as a Nova field with silvanite/nova-field-cloudinary and it works great but I have a need for the media-libaray which doesn't support it out of the box. So, what I did: - add cloudinary disk: 'cloudinary' => [ 'driver' => 'cloudinary', 'api_key' => env('CLOUDINARY_API_KEY'), 'api_secret' => env('CLOUDINARY_API_SECRET'), 'cloud_name' =>

Stripe Webhooks return 302 on laravel application, using spatie webhook

强颜欢笑 提交于 2019-12-13 03:48:55
问题 I am attempting to set up stripes webhooks in my laravel application. I have pulled in spatie's webhook package to help out, link below. https://github.com/spatie/laravel-stripe-webhooks My endpoint on stripe looks like https://myapp.ca/stripe/webhook Dev my routes Route::stripeWebhooks('stripe/webhook'); I have included the key in webhook config, and included in the verifyCsrfToken 'stripe/*', When I send a test I get <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta http-equiv=