Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the endpoint() option. #20

Merged
merged 2 commits into from
Feb 10, 2016
Merged

Conversation

timgws
Copy link
Member

@timgws timgws commented Feb 10, 2016

Instead of having to set an option on the view, you can now just use ->endpoint to specify the URL.

{{
    $datatable
        ->headers() // tell the table to render the header in the table
        ->columns('id', '#') // show # in the header instead of 'id'
        ->columns('name', 'Full name') // show 'Full name' in the header instead of 'name'
        ->endpoint(route('asd.asd'))
        // render just the table
        ->table()
}}

Originally, I was planning on having the endpoint() function call route directly (or use app->make(...)) but then I realised that this would stop you from using external urls and routes without a name. Also, endpoint(route(...)) is a little bit more expressive.

This means that you can also use endpoint(secure(...)), which is a syntax I am falling in love with :)

@Chumper
Copy link
Contributor

Chumper commented Feb 10, 2016

This seems like a good compromise and would be the way i would also implement this.
👍

timgws added a commit that referenced this pull request Feb 10, 2016
@timgws timgws merged commit 4bc4140 into OpenSkill:master Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants