I want to know about method chaining. Recently I have used method chaining in Laravel, it's working fine.
My Model name was Posts so when I want to select all names from posts it returns all names.
Posts::select('name');
And when I call below function to get one records it gives only one record.
Posts::select(name)->first();
I want to implement same scenario in my own class. I have a class of image uploading.
If I will upload only a file, it will be
Image::upload('pic')
But If I upload image with resize and watermark.
Image::upload('pic')->resize(200, 300)->addwatermark('image/logo.png');