Это видео недоступно.
Сожалеем об этом.

Query Search with Eloquent Local Scope on Laravel 5 4

Поделиться
HTML-код
  • Опубликовано: 3 мар 2017
  • Query Search with Eloquent Local Scope on Laravel 5 4
    How to make local scope with eloquent, case on query search laravel 5.4.
    Make function on model with name scopeNamefunction to make local scope.
    #related
    Generate Dummy Data with Seeder on Laravel 5 4 • Generate Dummy Data wi...
    Model Migration Controller in one line Command Laravel 5.4 • Model Migration Contro...
    Make Helper Function for Active Menu on Laravel 5 4 • Make Helper Function f...
    Migrate Error Specified Key was too Long on laravel 5 4 • Migrate Error Specifie...
    How to Enable Query Log Laravel on Anywhere • How to Enable Query Lo...

Комментарии • 48

  • @XX-ui5ro
    @XX-ui5ro 4 года назад

    Thanks Bro

  • @popohicintuka6082
    @popohicintuka6082 4 года назад

    thanks really helpful, but how about when you want to search by foreign key?

  • @MotivationHub-AKY
    @MotivationHub-AKY 6 лет назад +5

    Call to undefined method Illuminate\Database\Query\Builder::search() how to fix it??

  • @nasimamjad1315
    @nasimamjad1315 6 лет назад

    Excellent job. Got a help. Thank you

  • @midimojo
    @midimojo 6 лет назад

    Neat. This is pretty straightforward.

  • @samehatalla5026
    @samehatalla5026 6 лет назад

    Missing argument 2 for App\Visitor::Search(), called in C:\xampp\htdocs\AW\app\Http\Controllers\VisitorsController.php on line 21 and defined

  • @vicd8766
    @vicd8766 7 лет назад +1

    Cool. Presicely what I need.

  • @letsgrow4412
    @letsgrow4412 5 лет назад

    great video, no need of vocal

  • @afiqahsolehah7
    @afiqahsolehah7 6 лет назад

    Thank you sir.its work!!

  • @PauloRdeOFerraz
    @PauloRdeOFerraz 6 лет назад

    Thks!

  • @farisazrai6384
    @farisazrai6384 7 лет назад

    THANK YOU VERY MUCH

  • @krsubedi
    @krsubedi 6 лет назад

    Pretty Cool Thank you

  • @josetuz
    @josetuz 5 лет назад

    Nice tutorial! Thank you so much! Have you added any dependency?

  • @desykartika1290
    @desykartika1290 6 лет назад +1

    kalau code native nya kayak gini, gimana konversi ke laravel, antara controller dan view nya bang?

  • @enzotrompeneers3113
    @enzotrompeneers3113 6 лет назад

    Perfect!

  • @blu8762
    @blu8762 7 лет назад

    why did you make scopeSearch function in model ? and where did you use it ? plz help im lost

  • @agamurat3019
    @agamurat3019 5 лет назад

    can we make search from multiple models by using this?

  • @muhamadhafizal6233
    @muhamadhafizal6233 6 лет назад

    hello i got error
    BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::search()'

  • @ketanchaudhari8288
    @ketanchaudhari8288 6 лет назад

    Great :)

  • @exceptionalhero9055
    @exceptionalhero9055 6 лет назад

    Thanks , It's Working Fine That I expected. Many Many Thanks.. I wish I could Drinks with you..lol

  • @adecma
    @adecma  7 лет назад

    Not have column description. Check your structure table on migration

  • @mohammadfouladgar2746
    @mohammadfouladgar2746 6 лет назад

    Thank you for make this video.
    also, you can use this package for creating advanced query filter:
    github.com/mohammad-fouladgar/eloquent-builder

  • @roniitzhayek9263
    @roniitzhayek9263 7 лет назад

    Hi, I wrote your code and I got this errror from blase:
    Call to a member function appends() on array
    Any advice? thanks!

    • @adecma
      @adecma  7 лет назад

      roni itzhayek appends(['key' =>'value' ] )

  • @user-te3vi3of9z
    @user-te3vi3of9z 7 лет назад +2

    Hello. Got an exception : badmethodcall: call to undefined method illuminate\database\query\Builder::search()
    Please. Help!

    • @WanShamz
      @WanShamz 7 лет назад

      same here. plz help.

    • @user-te3vi3of9z
      @user-te3vi3of9z 7 лет назад

      Ridzuan Samsuri I made my query through Product::latest()->search($s)->paginate(4)
      In the view
      Maybe it'll work for you

    • @KillShotzSC
      @KillShotzSC 6 лет назад

      I am having this problem, Did you make it work?

    • @muhamadhafizal6233
      @muhamadhafizal6233 6 лет назад

      same here plz help me.

  • @asadulhaqmshani4737
    @asadulhaqmshani4737 6 лет назад

    In the form you did action = "{{ route('category.index')}}" , what does this mean? I tried putting my view file, report.blade.php, so my code is action = "{{ route('report')}}" but it gave me an error which say : Route [report] not defined. Why did this happen? Thankyou for your help.

    • @adecma
      @adecma  6 лет назад

      Asadul Haq M Shani you must named of route url, for can using helper of route()

    • @asadulhaqmshani4737
      @asadulhaqmshani4737 6 лет назад

      What is 'category.index' that you use?

    • @adecma
      @adecma  6 лет назад

      Asadul Haq M Shani generate the url of category

    • @asadulhaqmshani4737
      @asadulhaqmshani4737 6 лет назад

      okay thanks

    • @ALEXEIS
      @ALEXEIS 6 лет назад +1

      Route::get('/url', 'SearchController@result')->name('report');
      Make your route look like that in the web.php file; with emphasis on the last function: ->name('report');

  • @wladimirjaimes1663
    @wladimirjaimes1663 6 лет назад

    i need your revision please.

  • @NourBou13
    @NourBou13 6 лет назад

    It didn't work !!
    I don't see where you used the function scopeSearch() that you wrote on Model
    And I got an error: the function search is undefined

    • @lMarttini
      @lMarttini 6 лет назад

      run 'composer update' and try again

    • @justincv
      @justincv 6 лет назад +1

      Eloquent utilizes the function when App\Model::search('')->get(); is called

  • @muhammadmudasar6843
    @muhammadmudasar6843 7 лет назад

    >>> $a = App\Customer::search('pre')->get()
    Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'description' in 'where clause' (SQL: select * from `customers` where (`name` like %pre% or `description` like %pre%))'
    >>>
    Plz tell me what kind of error i cannot understand these error i just follow your video

  • @yudibaidillah2403
    @yudibaidillah2403 5 лет назад

    if relation 2 table ?

  • @dixingxu
    @dixingxu 6 лет назад

    hi! can you share the source code of this project? Thanks

  • @chaknop1560
    @chaknop1560 7 лет назад

    >>> $a= App\Model\Article::GetSearch('pre')->get()
    => Illuminate\Database\Eloquent\Collection {#789
    all: [],
    }
    not show result why ? plz