Jump to content

laravel / PHP not sure what this is called / how it works

Joveice

Hello,

 

So when I call my models etc like

$book = $books->where('name', 'somebook')->first();
echo $book->sales(); //returns all sales
echo $book->sales->today(); //returns all sales today

So this is something I could no. but here is the catch for me.

 

how do I make the ->today(); work? Currently I have no idea how I can add more functions, "sub functions to the sales function".

 

What am I looking for? I just need the name of this so I can learn how to do it.

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×