thiagousa

thiagousa

Member Since 1 Year Ago

Experience Points 7,930
Experience
Level
Lessons Completed 77
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • 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

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    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.

29 Oct
1 month ago

thiagousa started a new conversation Controller -> Static Or Construct

What is the best way to make this search at Database?

$users = User::all();

or

$users = $this->User->all();

12 Oct
2 months ago

thiagousa left a reply on Resource

It's works.

public function postsDataTables()
{
    $datatable = DataTables::of(PostResources::collection(Post::all()))->toJson();
    
    return $datatable;
}

Exemplo in this link - https://github.com/thiagousa/datatable

thiagousa left a reply on Resource

$posts = Post::with('user')->get();

return new PostCollection($posts);
11 Oct
2 months ago

thiagousa started a new conversation Resource

I have two table, and i need to take just the name of all user for post.

08 Oct
2 months ago

thiagousa left a reply on Datatable - Laravel

Document

    <h1>Table of Posts</h1>

    <div class="box-footer clearfix">
        <a href="{{ route('posts.create') }}"><button type="submit" class="btn btn-primary">Add New Post</button></a>
     </div>
     <hr>

    <table id="posts" class="table table-bordered">
        <thead>
            <tr>
                <th>Id</th>
                <th>Title</th>
                <th>created_at</th>
                <th>test</th>
                <th>action</th>
                      </tr>
        </thead>
    </table>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.js"></script>  
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js"></script>
<script>
$(function() {
    $('#posts').DataTable({
        processing: true,
        serverSide: true,
        ajax: "{{ route('posts.datatables') }}",
            columns: [
            {data: 'id', name: 'id'},
            {data: 'title', name: 'title'},
            {data: 'created_at', name: 'created_at'},
            {data: 'test', name: 'test'},
            {data: 'action', name: 'action', orderable: false, searchable: false}
                      
            ],
    });
});
</script>

thiagousa started a new conversation Datatable - Laravel

How can i do the buttons of my view doesn't use HTML in my Controller?

exemplo

public function postsDataTables() { $posts = Post::select(['id', 'title', 'created_at']);

    return Datatables::of($posts)
    ->addColumn('test', function ($post) {
        return $post->id;
    })
    ->addColumn('action', function ($post) {
        return '<a href="posts/'.$post->id.'/show" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> View </a> <a href="posts/'.$post->id.'/edit" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> Edit</a> <a href="posts/'.$post->id.'/delete" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> Delete</a>';
    })

    ->make(true);
}
04 Jan
11 months ago

thiagousa started a new conversation Redirection

I have the fresh Laravel 5.5 with this screen.

Index of /blog2 [ICO] Name Last modified Size Description [PARENTDIR] Parent Directory - [DIR] app/ 2018-01-04 15:33 - [ ] artisan 2018-01-04 15:33 1.6K [DIR] bootstrap/ 2018-01-04 15:33 - [ ] composer.json 2018-01-04 15:33 1.4K [ ] composer.lock 2018-01-04 15:35 140K [DIR] config/ 2018-01-04 15:33 - [DIR] database/ 2018-01-04 15:33 - [ ] package.json 2018-01-04 15:33 1.1K [ ] phpunit.xml 2018-01-04 15:33 1.0K [DIR] public/ 2018-01-04 15:33 - [ ] readme.md 2018-01-04 15:33 3.5K [DIR] resources/ 2018-01-04 15:33 - [DIR] routes/ 2018-01-04 15:33 - [ ] server.php 2018-01-04 15:33 563 [DIR] storage/ 2018-01-04 15:33 - [DIR] tests/ 2018-01-04 15:33 - [DIR] vendor/ 2018-01-04 15:35 - [ ] webpack.mix.js 2018-01-04 15:33 549

I wanna redirection every for the public the Laravel index.php, I don't wanna nobody has to access to my frameworks files.