Skip to content

Add the endpoint() option. - #20

Merged
timgws merged 2 commits into
OpenSkill:masterfrom
timgws:endpoint-update
Feb 10, 2016
Merged

timgws merged 2 commits into
OpenSkill:masterfrom
timgws:endpoint-update

Conversation

@timgws

@timgws timgws commented Feb 10, 2016

Copy link
Copy Markdown
Member

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

Chumper commented Feb 10, 2016

Copy link
Copy Markdown
Contributor

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