tntstudio

tntstudio

Member Since 3 Years Ago

Experience Points 4,430
Experience
Level
Lessons Completed 95
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.

15 Aug
1 year ago

tntstudio left a reply on Prevent Tnt Search From Converting Space To ' AND '

The short answer is that TNTSearch doesn't do that. Make sure that your config is not set to boolean search

09 Nov
2 years ago

tntstudio left a reply on Scout Return An Empty Collection

You should try to search for a city that actually exists in your db, not a single character.

07 Nov
2 years ago

tntstudio left a reply on Scout & TNTSearch. Attempt To Write A Readonly Database

You need to make sure that the file/folder is writable.

chmod -R 0777 /path/to/index

04 Oct
2 years ago

tntstudio left a reply on Algolia Highlighting In Laravel 5.3

If you try with with another driver like tntsearch you'll have access to a highlighter class and would use it like:

use TeamTNT\TNTSearch\TNTSearch;

$articles = Article::search($searchString)->get();
$tnt = new TNTSearch;

$articles = $articles->map(function($article) use ($searchString, $tnt) {
    $article->title = $tnt->highlight($title, $searchString, 'em'),
});

The third argument of the highlight method is the html element you want to use

21 Sep
2 years ago

tntstudio left a reply on How To Disable Scout When Testing?

The NullEngine is already built into scout. Try adding extra quotes like <env name="SCOUT_DRIVER" value="\'null\'"/>

26 Aug
2 years ago

tntstudio left a reply on Search Option In Laravel 5

@shacall2 yes it does. TNTSearch works with postgresql

26 Jun
2 years ago
18 May
2 years ago

tntstudio left a reply on Search Option In Laravel 5

I know it's an old topic but take a look at this http://tnt.studio/blog/searching-for-bobby-fisher-with-laravel-5 it's a fully featured full text search tutorial for users, just like you've asked :)

13 Apr
2 years ago

tntstudio left a reply on Full Text Searching

Don't know if it's too late, but I have been struggling with the same problems as you so I created this library that deals with full text search

https://github.com/teamtnt/tntsearch

06 Apr
2 years ago

tntstudio left a reply on Search By Multiple Fields Or Inputs

TNTSearch can accept multiple inputs and search by all of the fields you want. The first thing would be to craeate an index, after that, you can query the index which will return the matching document ids.

https://github.com/teamtnt/tntserach

tntstudio left a reply on Looking For A Search Engine For My Laravel App

If you're looking for an easy but performant solution try https://github.com/teamtnt/tntserach

29 Dec
2 years ago

tntstudio left a reply on Using Views For Columns In Datatables

I found one way to do this, I put (string) before the view method, now it looks like this: my controller: ´´´ public function data() { return Datatables::of(Page::select('*')) ->addColumn('options', function ($page) { return (string) view('options', ['id' => $page->id]); }) ->make(true); } ´´´ my view: ´´´

$(function() { $('table').DataTable({ processing: true, serverSide: true, ajax: '{!! route('pages.data') !!}', columns: [ { data: 'id', name: 'id' }, { data: 'title', name: 'title' }, { data: 'options', name: 'options', sortable: false } ] }); }); ´´´

tntstudio left a reply on Using Views For Columns In Datatables

i'm getting "[object Object]" right now

tntstudio started a new conversation Using Views For Columns In Datatables

Hello everybody..

I'm using yajra/laravel-datatables in my project and need to have an additional column for view/edit/delete actions.. Currently I'm displaying it this way:

<script id="options" type="text/html">
<div class="text-right">
<a class="btn btn-xs btn-primary" href="/pages/id"><i class="glyphicon glyphicon-eye-open"></i> View</a>
<a class="btn btn-xs btn-warning" href="/pages/id/edit"><i class="glyphicon glyphicon-edit"></i> Edit</a>
<a class="btn btn-xs btn-danger"  href="/pages/id" delete><i class="glyphicon glyphicon-trash"></i> Delete</a>
</div>
</script>

<script>
$(function() {
    $('table').DataTable({
        processing: true,
        serverSide: true,
        ajax: '{!! route('pages.data') !!}',
        columns: [
        { data: 'id', name: 'id' },
        { data: 'title', name: 'title' },
        {
           sortable: false,
           render: function ( data, type, full, meta ) {
            return $('#options').html().replace(/id/g, full.id);                
            }
        }
    ]
});
});
</script>

According to the documentation of the yajra datatables package, it can be done in the controller:

http://datatables.yajrabox.com/eloquent/add-edit-remove-column

Is there a way to use a partial for this instead of writing the string in the addColumn method?

I'd like to do something like this in my controller:

public function data()
    {
        return Datatables::of(Page::select('*'))
        ->addColumn('action', function ($page) {
                return view('options', ['id' => $page->id]);
            })
        ->make(true);
    }

and I have a options.blade.php file also:

<a class="btn btn-xs btn-primary" href="{{ route('offers.show', $id) }}"><i class="glyphicon glyphicon-eye-open"></i> View</a>
<a class="btn btn-xs btn-warning" href="{{ route('offers.edit', $id) }}"><i class="glyphicon glyphicon-edit"></i> Edit</a>
<a class="btn btn-xs btn-danger"  href="{{ route('offers.destroy', $id) }}" delete><i class="glyphicon glyphicon-trash"></i> Delete</a>