ForestAdmin / forest-laravel

🌱 Laravel Liana for Forest Admin. This repo is no longer maintained. Please use laravel-forestadmin instead: https://github.com/ForestAdmin/laravel-forestadmin
GNU General Public License v3.0
4 stars 0 forks source link

[+] Custom Search - Developers can restrict the search to specific collection fields #70

Closed ArnaudValensi closed 6 years ago

ArnaudValensi commented 6 years ago

To configure a collection:

return [
  'secret_key' => '7a3049f8cd14e719c219e6d75e2a7715eef38bf6ec4be2ffc774a3374c9196a8',
  'auth_key' => 'l8oeFltNrdrbq6pPeEGzxbG47h2qCK46',
  'models_path' => 'app',
  'url' => 'http://localhost:3001',
  'debug_mode' => true,
  'collection' => [
    'AppPost' => [
      'search_fields' => ['id', 'title', 'users.password'],
    ],
    'AppUser' => [
      'actions' => [
        ['name' => 'unban']
      ]
    ]
  ]
];

Compared to before:

return [
  'secret_key' => '7a3049f8cd14e719c219e6d75e2a7715eef38bf6ec4be2ffc774a3374c9196a8',
  'auth_key' => 'l8oeFltNrdrbq6pPeEGzxbG47h2qCK46',
  'models_path' => 'app',
  'url' => 'http://localhost:3001',
  'debug_mode' => true,
  'actions' => [
    'AppUser' => [
      ['name' => 'ban']
    ]
  ]
];

The old way is still working though.

To create a smart action, old fashion: https://gist.github.com/arnaudbesnier/9d10918516b9c6f15ae56e76446aa9cd#file-forestsmartactionlaravel-php

Laravel 5.5+: https://gist.github.com/ArnaudValensi/3a5e50bc50a214f631e8e6e25aedd881

ArnaudValensi commented 6 years ago

(5) Custom Search - Search requests take a very long time to be done on his collections and it is a blocker to go PRO customer