Member Since 1 Year Ago

Experience Points 21,620
Experience Level 5

3,380 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 172
Best Reply Awards 1
Best Reply
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement


    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement


    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

06 May
2 weeks ago

ronon left a reply on One To One Relationship

InventoryJob hasOne SubJob

SubJob belongsTo InventoryJob

21 Apr
1 month ago

ronon left a reply on Why Does \Log Not Work In Jobs

\Log::info(); Log::debug() are working in jobs. Make sure that if you use Linux thtat your files have the same owner as the webserver is running under, e.g. www-data.

It doesn't has to do with what for a QUEUE_DRIVER you're using

16 Apr
1 month ago

ronon started a new conversation Queue Retry: Failed Method Executed But Job Is Active

It can happen that a long running job fail. We're talking about an encoding job which can run longer than 30+ minutes. So I configured the supervisor with the --timeout=0 option.

Now I wrote an endpoint to restart a failed job. It basically calls the artisan command:

 Artisan::call('queue:retry', [
                    'id' => $job->id

So far so good, the job is also restarted.

But now the weird things are happening. After approx 30 secs the failed method in my job is called

     * The job failed to process.
     * @param  Exception  $exception
     * @return void
    public function failed(Exception $exception)
       // Update some values in the db
        Log::debug('Job failed '. $exception->getMessage());

The message from the log: ProcessVideo has been attempted too many times or run too long. The job may have previously timed out. Since retry resets the attempts, I guess it's thrown because of a timeout exception?!?

But here it gets really weird. With htop I can still see the job running through supervisor. All values are updated as expected like if it wasn't cancelled.

So why is the failed job method called but the job itself is still active? How can I prevent this behaviour?

02 Apr
1 month ago

ronon left a reply on One To One Relationship

If you're sure that in no case the InventoryJob can has multiple childs, go for the One to One relation, else you need to go for the One to Many

ronon left a reply on Accessing Localhost From My Iphone?

You need to setup a webserver on your MacBook to achieve this.

ronon left a reply on How Do I Find Out How Many Times

The LIKE operator matches everything that contais Dram. So it's not possible to achieve the behaviour you want with your design. In your design your categories are not allowed to be similiar to another categories name.

The only way you can solve this is using a Many-To-Many relation. You will then have 3 tables: posts, categories and category_post. category_post will look sth like this:

post_id | category_id

Make sure you use a unqiue ID on that, else it can happen that a post has the same category more than once.

So later you can do:

$post = Post::first();

ronon started a new conversation Beanstalk Create New Tube?

Since the servers are running different long running processes I'm use beanstalkd queue. To prevent a server fetching all jobs i'm want to check the size of the queue with:




but I receive this error:

 Pheanstalk\Exception\ServerException  : Server reported NOT_FOUND

  at /var/www/html/laravel/vendor/pda/pheanstalk/src/YamlResponseParser.php:37
    33|      */
    34|     public function parseResponse($responseLine, $responseData)
    35|     {
    36|         if ($responseLine == Response::RESPONSE_NOT_FOUND) {
  > 37|             throw new Exception\ServerException(sprintf(
    38|                 'Server reported %s',
    39|                 $responseLine
    40|             ));
    41|         }

  Exception trace:

  1   Pheanstalk\YamlResponseParser::parseResponse("NOT_FOUND")

  2   Pheanstalk\Connection::dispatchCommand(Object(Pheanstalk\Command\StatsTubeCommand))

  Please use the argument -v to see more details.

I push to queue with this this command:




I use beanstalkd Admin UI to monitor the queues and it shows that the audio queue doesn't exists, but the video queue does.

I guess the video queue exists, since i tried it a few times before I added the method to check the queue size?!?

So how do I create a new tube and prevent this error? I know that I could use a try catch but that seems like a bad approch imho.

01 Apr
1 month ago

ronon left a reply on Installing Laravel In A Subdirectory - Images Not Showing

Why don't you use the location setting of your webserver? For example if you use nginx:

location ~ /subfolder { root /path/to/your/second/laravel/installation; }

and add the other neccessary stuff.

Is using a subdomain not an option at all?

ronon left a reply on Remember The Owner Of An Uploaded File Without Force Him To Sign In?

I would go with a cookie. User visits your site -> set cookie with an unique id. User uploads documents -> use that id and prefix the filenames. User registers -> Parse the files and assign the user to it.

Note: Any client side method may break if the user uses private sessions or things like NoScript

ronon left a reply on How Do I Find Out How Many Times

I guess the type of post_categories is text? If so use LIKE. WHERE post_categories LIKE '%$yourValue%'

But you should better use an One-To-Many relation, since the categories are going to be repeated

ronon started a new conversation Avoid Race Condition. Best Way To Lock Resource?

I have a multi server setup where some server have specific tasks. A server can get a new task through an endpoint. /api/task

Since the tasks are fetched through cronjobs, it can happen that some servers are trying to fetch a new task at the same time. Since I need to do many database requests and some calculation this process can take some time. So I thought of using some kind of lock to prevent incorrect values in the database and accidentailly assigning a job to more than one server.

Should I go for Database transaction or should i better use a variable stored in the cache, or any other approach?

ronon left a reply on How Do I Find Out How Many Times

First of all your images aren't working.

Next: So you want to count the occurences of a specific category name in nother table? Your query needs to look like similiar to this

SELECT count(*) FROM posts WHERE category_name = 'yourCategoryValue';
15 Mar
2 months ago

ronon left a reply on Relationship Null In Console

That doesn't matter. The model is loaded correctly no matter how i do it, the relation won't load! As already mentioned i broke it down to the point where it's not working.

ronon left a reply on Relationship Null In Console

@snapey i broke it down to the part what's not working and forgot to add the where('slug', $slug) part. But that also won't explain why it's working in browser but not from console

14 Mar
2 months ago

ronon left a reply on Relationship Null In Console

@CRONIX - Yes. If i run it with through web, it also works as expected. It just won't work if i try it from console.

ronon left a reply on Relationship Null In Console

@snapey updated the post, but i guess it will not help.

ronon started a new conversation Relationship Null In Console

I need to load relationships on a command.

The problem is that it's always null.

I tried it with with('myrelation') and load('myrelation') but it's always empty. Running it from browser the relationship is available.

Why the heck is it null? I don't get it

13 Mar
2 months ago

ronon left a reply on Ajax Not Posting Data. What Am I Doing Wrong?

@stereoh you're right my fault


Don't know which jQuery versino you're using, but success has been removed in 3.0. Also your success aproach looks wrong for me.


                    method: "POST",
                    url: "{{ url('/lessons') }}",
                    data: {
                        name: jQuery('#title').val(),
                        description: jQuery('#description').val(),
                        title: jQuery('#title').val(),
                        release_after: jQuery('#release_after').val()
                    .done(function( msg ) {

ronon left a reply on Ajax Not Posting Data. What Am I Doing Wrong?

You never fall the ajax part

You closedthe click function before tue ajax part

26 Feb
2 months ago

ronon started a new conversation Best Way To Assign The Disabled Tag To Input Values

I need to assign the disabled tag on multiple values depending on a entry on the ´user´ model.

What's would be the best way to do that without writing this peace of code over and over again on every input field?

{{ Auth::user()->disabled ? 'disabled' : '' }}

Ideas I came up with are: Create a Blade::directive and Create a view where it contains the logic and import it on every view.

I'm not sure if those two ways are good ones. Sp what would be the best way to do this?

06 Feb
3 months ago

ronon left a reply on Control Number Of Queue Workers With A Value From Config

I would like to control the amount of running encoding processes on each app server from the main server. So I need some sort of control of the supervisor and/or the queue. Or any other idea how to solve it

ronon started a new conversation Control Number Of Queue Workers With A Value From Config

Is it possible to control the number queue workers with a value from the config file? E.g. run 3 workers.

We are using ffmpeg to convert video files. This are long running tasks. I thought of using laravel queues with supervisor to deal with it, but as mentioned, it has to be controlable how many ffmpeg processes should run at the same time.

Is it possible to archive this behavior with Laravel and queues?

If not do you have any recommendations how we can solve this issues?

04 Jan
4 months ago

ronon left a reply on ToCustomChannelName Not Called

@d9705996 You're totally right. Don't know how i could overread that. Thanks!!! :)

ronon started a new conversation ToCustomChannelName Not Called

We're using FirebaseCloudMessaging to push notifications to our android app. For this we use .

Now i wrote a channel to handle the stuff, but the toFirebaseCloudMessaging($notification) isn't called.

The notification file

namespace App\Notifications;

use App\Channels\FirebaseCloudMessagingChannel;
use App\Models\Message;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;

class NewMessage extends Notification

     * @var
    protected $message;

     * Create a new notification instance.
     * @return void
    public function __construct(Message $message)
        $this->message = $message;

     * Get the notification's delivery channels.
     * @param  \App\Models\User  $notifiable
     * @return array
    public function via($notifiable)
        return [FirebaseCloudMessagingChannel::class];

    public function toFirebaseCloudMessaging($notifiable)
        dd('toFirebaseCloudMessaging called');
        return 'test message';

the channel:

namespace App\Channels;

use Illuminate\Notifications\Notification;
use LaravelFCM\Facades\FCM;
use LaravelFCM\Message\OptionsBuilder;
use LaravelFCM\Message\PayloadDataBuilder;
use LaravelFCM\Message\PayloadNotificationBuilder;
use Spatie\Fractalistic\ArraySerializer;

class FirebaseCloudMessagingChannel

     * Send the given notification.
     * @param  mixed  $notifiable
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return void
    public function send($notifiable, Notification $notification)

// Send the notification

I call the notification like:
Notification::send($users, new NewMessage($message));

but in the NewMessage class the toFirebaseCloudMessaging method isn't called. It goes directly to the send() method in the channel.

What am I doing wrong?

29 Nov
5 months ago

ronon started a new conversation Facade Not Working And Autocomplete Not Showing

I need to use youtube_dl in a project. For this i want to use this wrapper, unfortunatly there is no facade available for it, so i wanted to write one on my own.

in app\Facades i created a faceade YoutubeDlFacade

namespace App\Facades;

use Illuminate\Support\Facades\Facade;

class YoutubeDlFacade extends Facade
     * Get the registered name of the component.
     * @return string
    protected static function getFacadeAccessor()
        return 'youtubedl';

I also created a ServiceProvder YoutubeDlServiceProvider.


namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use YoutubeDl\YoutubeDl;

class YoutubeDlServiceProvider extends ServiceProvider

     * Indicates if loading of the provider is deferred.
     * @var bool
    protected $defer = true;

     * Bootstrap any application services.
     * @return void
    public function boot()

     * Register any application services.
     * @return void
    public function register()
        $this->app->singleton('youtubedl', function ($app) {
            return new YoutubeDl();

        $this->app->alias('youtubedl', 'YoutubeDl\YoutubeDl');

     * Get the services provided by the provider.
     * @return array
    public function provides()
        return [ 'youtubedl' ];

I registered the ServiceProvider in the configs array. ´

Now I have two problems: First, this works:

$youtubeDl = app('youtubedl');

This don't:


Here i get this error Non-static method YoutubeDl\YoutubeDl::getExtractorsList() should not be called statically

Second, i don't get the autocomplete suggestions from PHPStorm.

28 Nov
5 months ago

ronon left a reply on Convert Custom Non Eloquent Model To Json

I want to have the flexibility the Model has. So I extend from Model and call the parent constructor with the attributes array. Also I have set the fillable array to the same values as the attributes array

protected $attributes = ['title', 'content'];

public function __construct(){

But now I get

  0 :  [
    [ 'title', 'content'], [ 'title', 'content'], [ 'title', 'content']]

Shouldn't that do the trick?

ronon started a new conversation Convert Custom Non Eloquent Model To Json

I have a custom model, which is not filled with data from the database.

class MyModel {
          * @var string
    protected $title;

    // Getter and setter for it

I also tried to extend it extend Model but i always get an empty response.

  0 :  [[],[],[],[]]

How can I get it to work that i can use return response()->json($data).

17 Oct
7 months ago

ronon left a reply on Laravel Queue

Provide more info

09 Oct
7 months ago

ronon left a reply on Error In Integrate Bootstrap With Laravel

Remove the .../public asset('css/bootstrap.min.css')


22 Aug
8 months ago

ronon started a new conversation Trait Not Found

I have read many other threads regarding this issue, but nothing helped.

I'm using laravel 5.5 and for the passwordreset is overwrote the setPasswordAttribute function

User extends Authenticatable{
public function setPasswordAttribute($value)
            $this->attributes['password'] = bcrypt($value);

Now I had to modify the ResetPasswords file, because i had to change this line

        $user->password = Hash::make($password);

to this

$user->password = $password;

I have a folder for traits under App\Traits.

I copied the whole content from ResetsPasswords to App\Traits\ResetsPasswordTrait and modified the line


namespace App\Traits;

use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Password;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Foundation\Auth\RedirectsUsers;

trait ResetsPasswordsTrait
    use RedirectsUsers;


     * Reset the given user's password.
     * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
     * @param  string  $password
     * @return void
    protected function resetPassword($user, $password)
        $user->password = $password;



        event(new PasswordReset($user));



I updated the trait in ResetPasswordController


namespace App\Http\Controllers\Auth;

use App\Traits\ResetsPasswordsTrait;
use App\Http\Controllers\Controller;

class ResetPasswordController extends Controller
    | Password Reset Controller
    | This controller is responsible for handling password reset requests
    | and uses a simple trait to include this behavior. You're free to
    | explore this trait and override any methods you wish to tweak.

    use ResetsPasswordsTrait;

     * Where to redirect users after resetting their password.
     * @var string
    protected $redirectTo = '/home';

     * Create a new controller instance.
     * @return void
    public function __construct()

I have other Traits in the foler as well which are working which are working but for this one I always get a Trait not found exception. I executed composer dump-autoload and php artisan clear:cache but I cannot get rid of it. What's wrong with my code?

14 Aug
9 months ago

ronon left a reply on Change Form Of Address Efficiently

Thats not what I'm looking for. The authorization is working as it should. I have many parts where I need to change the phrase the user sees depending on if the user is visiting his own profile or not. I think it's suboptimal to do it like

if(auth->id == $user->id)
  print this
    print that

those checks in the blade files is getting too much, need to refactor it to a better way to do it

ronon started a new conversation Change Form Of Address Efficiently

I need to change the form of address depending if the owner is visiting his profile or if anyone else is visiting it.

Is there a better way than do it like

@if(auth()->id() === $user->id)
       Your friends
    Friends of $user->name

The string are located in language files.

I thought of an one liner, maybe like

echo getFormOfAddress('string for owner', 'string for foreigners', $user(?));

function getFormOfAddress($owner, $foreigner, $visitedUser){
    return ($visitedUser->id === auth()->id()) ? $owner : $foreigner;

but i guess there might be a better way to do it with laravel where i'm not aware of.

Maybe someone knows a better solution for it :)

16 Jul
10 months ago

ronon started a new conversation Override Can Policy Response

I use Policies to check if an user has the permission to perform an action. For the api endpoint I need to put that response in a specific format.

If a user who is not allowed to view messages for a message Route::get('/{message}/messages', '[email protected]')->middleware('can:view,message')

it throws a 403 error.

But I need to have it as a json ouput like:

    error: true,
    msg: 'Unauthorized'

How can I override it?

24 Jun
10 months ago

ronon started a new conversation Log In Scheduled Tasks Breaks API. Only Log From Tasks Appear In Log File

On a website i have an API and approx. 12 scheduled tasks. Some of these tasks run once daily, others every minute or hourly. If I use Log::debug, Log::info, Log::error in one of these tasks the api endpoint breaks completly and I receive 500 - Server errors and no further error message in the logs, neither in nginx nor laravel.

The website is usable as always, but also won't write anything to the log. Only the Log:: from the tasks occur in the log.

What causes this behaviour?

I use daily logs with log_level debug.

ronon left a reply on User Session In API Response

If you use any kind of authenthication, you are authenticated. So you even don't need to use Auth::check

23 Jun
10 months ago

ronon left a reply on User Session In API Response

You can use Auth::check on the API side as well.

13 Jun
11 months ago

ronon left a reply on NPM Installing Scripts And Then Running Them On My Blade Template

the php section is the wrong way for this.

How it should work.

  1. npm install --save toastr

  2. Include in your resources/assets/js/app.js file.

  3. compile it npm run watch see for options like production/dev

  4. include the js file from your public/js/app.js at the end of your body.

Use it'Are you the 6 fingered man?')

Don't forget to include the css file!

08 Jun
11 months ago

ronon started a new conversation How To Use PECL/Pear Extensions In Laravel?

I need to use pecl/pear extension in my laravel app, but I really don't have a clue how to include them the proper way.

For example this package:

Where do I have to place the require_once "Net/CheckIP.php"; so it works in laravel?

I know that to use require_once in a controller is a nogo.

21 May
1 year ago

ronon started a new conversation Merge Two Huge Collections 10k+ Items Each, One Is An Eloquent Collection The Other An [array] Collection

I have two collection. One is an eloquent collection files and the other one is a file array converted to a collection.

I need to lookup if the file array is already in the database and append some attributes to the file array. For example if the file exists in the database, if the file was modified etc..

// create collection from files array
$collection = collect($files);

// First idea
// Chunk it, so the eqloquent collection is smaller
foreach($collection->chunk(1000) as $chunk){

      // ID list for db query
    $ids = $chunk->pluck('file_id')->toArray();
        $files = File::whereIn('file_id', $ids)->get();

       foreach($chunk as $file){
             // Here it gets tricky
             // I need to check if the file exists in the $files collection
            // I tried it with
            $found = $files->where('file_id', $file->file_id)->first();
            // But the execution time exceeds

                 // Add some values, like, etc...
                $file->existsInDb = true;
                $file->created_at = $found->created_at;
             } else {
               $file->existsInDb = false;
                $file->created_at = -1;

return $files;

file_id is type of string and unique.

How can I improve the $found = $files->where('file_id', $file->file_id)->first(); search in the collection part?

If i make a query for each File i receive an 504 Gateway Timeout, so I think the database don't like that approach.

Might there be a much better approach for this problem?

ronon left a reply on Generate Multidimensional Array From Singledimensional Array, Entry Only Nows It's Parent

@jlrdw The dataset didn't come from the database, so wasn't an option

@hjgarcia1 You brought me on the correct path. Had to do it as tree. Thanks for that :)

This solution worked for me

ronon started a new conversation Generate Multidimensional Array From Singledimensional Array, Entry Only Nows It's Parent

I have the following array

         name = 'Root',
    id= 1,
         name = 'Images',
    id= 456,
        parent_id = 1
         name = '2018',
    id= 5756,
        parent_id = 456
         name = 'uploads',
    id= 45879,
        parent_id = 5756
         name = '2017',
    id= 534,
        parent_id = 456

It's a single dimensional array. Each entry only nows its parent according to the given id. The parent doesn't knows if it has children until you visit it.

How can I create an mutlidimensionales array like


To clarify, i need the following structure.

  - Images
     - 2018
       - uploads
          - more folders
    - 2017
     - wedding
     - vacation
        - toSort
  - Videos
    - Funny
    - Movies
      - Action


I can only archieve it till level 2Images

 $data = [];
        foreach($folders as $folder){

            // Parent directory
                $data [$folder->name]['id'] = $folder->id;
                $data [$folder->name]['name'] = $folder->name;
            } else {

                // Get all parent folders for the given folder
                $parents = array_reverse($this->parentFolder($folder));
        // How to go further?
              // Use the parents as access key??


18 May
1 year ago
17 May
1 year ago

ronon started a new conversation Redis Sorted Hashes On Score Like In Sorted Sets Zrange

I'm writing kind of a firewall for laravel. I'm using redis to prevent performance issues.

I need to store the counts on a daily base. So i have to be able to access the current count of a specific key:value base. I came up with hashes, like

Redis:hincrby($key, $ip, 1);

So i can access the value

Redis::hget($key, $ip);

But for statistic issues i would like to get the ips with the most hits.

How can i get the top x hits, like it is possible with sorted sets?

Redis::zrange(0, 10, WITHSCORES);

Do i need to store the hits additionally in a sorted set, or is there a way to achieve this behavior with hashes as well? Or do I need to use a different type? Or is there a way to access a entry in a sorted set like in a hash?

15 May
1 year ago

ronon left a reply on Custom Exception Handler Throws Exception Instead Of Parsing It

Ahh now i understand it, thanks for the clarification :)

ronon started a new conversation Custom Exception Handler Throws Exception Instead Of Parsing It

I need to modify the response of the ValidationException so I created myself an exception.

namespace App\Exceptions;

use Exceptions;

class ValidationException extends Exception

    public function __construct($message){

I also added my Exception to Handler.php


namespace App\Exceptions;

use App\Utils\ResponseUtil;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
    protected $dontReport = [

    public function report(Exception $exception)

    public function render($request, Exception $exception)
        return parent::render($request, $exception);

    protected function unauthenticated($request, AuthenticationException $exception)
        if ($request->expectsJson()) {
            return response()->json(ResponseUtil::makeError('Unauthenticated.'), 401);

        return redirect()->guest(route('login'));

If i call it now in a Request


namespace App\Http\Requests\Api;

use App\Exceptions\ValidationException;
use App\Models\User;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Http\FormRequest;

class RegisterRequest extends FormRequest
    public function authorize()
        return true;

    public function rules()
        return User::$rules;

    protected function failedValidation(Validator $validator)
        throw (new ValidationException('Validation failed at register process'));

But it throws an exception for the ValidationException.

If i add a render method to my ValidationException and return a response it works.

Do I have to apply a render method to it? As far as i understood I have to add my exception to the $dontReport array in Handler.php, also that render method should be called, or am I totally wrong?

06 May
1 year ago

ronon left a reply on Share Image On Multiple Sites After Image Job Is Processed

I would like that the sites are processed kinda parallel. So I think creating a new job for each site would be the better way?!?

ronon started a new conversation Start, Stop, Pause, Remove On A Running Job In A Queue

Is it possible to perform those actions, start if paused, stop, pause and remove, on a running job in a queue?

Couldn't find anything related to this.

ronon started a new conversation Share Image On Multiple Sites After Image Job Is Processed

A user can upload any amount of images to a server. There the image is stored in the database and processed afterwards.

The user can select mutliple services before the upload, which tells the script, where he wants to share the image. FB, Twitter, etc...

First step I store the image in the database:


Next I convert and resize the image with a job and chain it with the ShareImage job


But now that the user can select only the sites where he wants to share the image, i don't know how to create a job for each site the image should be shared on.

Should I chain the jobs and the last job creates new jobs for each site?

    new ShareImage($image)


class ShareImageimplements ShouldQueue
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $image;
    protected $sites;

     * Create a new job instance.
     * @return void
    public function __construct(Image $image, $sites = [])
        $this->image= $image;
    $this->sites = $sites;

     * Execute the job.
     * @return void
    public function handle()
        foreach($this->sites as $site){
        // Determine the site with a Factory
              // Now generate a job for it, or....? 

Would this be a good approach or...?

I thought about creating the chain array dynamically, but this would make each site dependent from the previous job, right? Or is there a way to create only from the main job dependable jobs?

03 May
1 year ago

ronon left a reply on Broadcasting - Pusher

Dou you start the worker so the queue is processed?