title: "Class datatables does not exist" Error when using "yajra" laravel datatables
body: <p>I want to show a list of my posts table rows via <strong><a href="https://www.datatables.net" rel="nofollow noreferrer">datatables</a></strong> jquery plugin with laravel version 5.1 via <a href="https://github.com/yajra/laravel-datatables" rel="nofollow noreferrer"><strong>yajra-laravel-datatables</strong></a>.  </p>
  
  <p>For that I do all instructions described in this <a href="http://datatables.yajrabox.com/starter" rel="nofollow noreferrer">Quick Start Giude</a> in my project. </p>
  
  <p>this is my Route only for get all data that are Necessary for dataTable:</p>
  
  <pre><code>Route::get('postsData', 'postController@testData');
  </code></pre>
  
  <p>and this is complete postController php file :</p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use App\Http\Requests;
  use App\Post;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Input;
  use Illuminate\Support\Facades\Redirect;
  use Illuminate\Support\Facades\View;
  use yajra\Datatables\Datatables;
  
  class postController extends Controller
  {
  
      public function index ()
      {
          $allPosts = Post::all();
          return \View::make('admin.pages.posts')-&gt;with('posts', $allPosts);
      }
  
  
      public function create ()
      {
          return \View::make('admin.pages.post_create');
      }
  
  
      public function store (Request $request)
      {
          $data = Input::all();
  
          $rules = array (
              'post_title' =&gt; 'required',
              'post_desc'  =&gt; 'required'
          );
  
          $validator = \Validator::make($data, $rules);
  
          if ($validator-&gt;fails()) {
              return \Redirect::to('/admin/posts/create')
                  -&gt;withErrors($validator)
                  -&gt;withInput();
          } else {
  
              $post             = new Post();
              $post-&gt;post_title = $data['post_title'];
              $post-&gt;post_desc  = $data['post_desc'];
              $post-&gt;save();
  
              return \Redirect::to('/admin/posts');
          }
      }
  
  
      public function show ($id)
      {
          $post = Post::find($id);
  
          return \View::make('admin.pages.show_post')-&gt;with('post', $post);
      }
  
  
      public function edit ($id)
      {
          $post = Post::find($id);
          return \View::make('admin.pages.edit_post')-&gt;with('post', $post);
      }
  
  
      public function update (Request $request, $id)
      {
          $data = Input::all();
  
          $rules = array (
              'post_title' =&gt; 'required',
              'post_desc'  =&gt; 'required'
          );
  
          $validator = \Validator::make($data, $rules);
  
          if ($validator-&gt;fails()) {
              return \Redirect::to('post/create')
                  -&gt;withErrors($validator)
                  -&gt;withInput();
          } else {
  
              $post             = Post::find($id);
              $post-&gt;post_title = $data['post_title'];
              $post-&gt;post_desc  = $data['post_desc'];
              $post-&gt;save();
  
              return \Redirect::to('admin/posts');
          }
      }
  
  
      public function destroy ($id)
      {
          $post = Post::find($id);
          $post-&gt;delete();
  
          return Redirect::to('admin/posts');
      }
  
  
      public function postsAll(){
          return View::make('admin.pages.postsAll');
      }
  
      public function testData(){
          return Datatables::of(Post::select('*'))-&gt;make(true);
      }
  }
  </code></pre>
  
  <p>also I add <strong>Service Provider and Facade</strong> to <strong>config/app.php</strong> :</p>
  
  <pre><code>return [
      'debug'           =&gt; env('APP_DEBUG', false),
      'url'             =&gt; 'http://localhost',
      'timezone'        =&gt; 'UTC',
      'locale'          =&gt; 'en',
      'fallback_locale' =&gt; 'en',
      'key'             =&gt; env('APP_KEY', 'SomeRandomString'),
      'cipher'          =&gt; 'AES-256-CBC',
      'log'             =&gt; 'single',
  
  
      'providers'       =&gt; [
  
          /*
           * Laravel Framework Service Providers...
           */
          Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
          Illuminate\Auth\AuthServiceProvider::class,
          Illuminate\Broadcasting\BroadcastServiceProvider::class,
          Illuminate\Bus\BusServiceProvider::class,
          Illuminate\Cache\CacheServiceProvider::class,
          Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
          Illuminate\Routing\ControllerServiceProvider::class,
          Illuminate\Cookie\CookieServiceProvider::class,
          Illuminate\Database\DatabaseServiceProvider::class,
          Illuminate\Encryption\EncryptionServiceProvider::class,
          Illuminate\Filesystem\FilesystemServiceProvider::class,
          Illuminate\Foundation\Providers\FoundationServiceProvider::class,
          Illuminate\Hashing\HashServiceProvider::class,
          Illuminate\Mail\MailServiceProvider::class,
          Illuminate\Pagination\PaginationServiceProvider::class,
          Illuminate\Pipeline\PipelineServiceProvider::class,
          Illuminate\Queue\QueueServiceProvider::class,
          Illuminate\Redis\RedisServiceProvider::class,
          Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
          Illuminate\Session\SessionServiceProvider::class,
          Illuminate\Translation\TranslationServiceProvider::class,
          Illuminate\Validation\ValidationServiceProvider::class,
          Illuminate\View\ViewServiceProvider::class,
          Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
          yajra\Datatables\DatatablesServiceProvider::class,
          /*
           * Application Service Providers...
           */
          App\Providers\AppServiceProvider::class,
          App\Providers\AuthServiceProvider::class,
          App\Providers\EventServiceProvider::class,
          App\Providers\RouteServiceProvider::class,
  
      ],
  
  
  
      'aliases'         =&gt; [
  
          'App'        =&gt; Illuminate\Support\Facades\App::class,
          'Artisan'    =&gt; Illuminate\Support\Facades\Artisan::class,
          'Auth'       =&gt; Illuminate\Support\Facades\Auth::class,
          'Blade'      =&gt; Illuminate\Support\Facades\Blade::class,
          'Bus'        =&gt; Illuminate\Support\Facades\Bus::class,
          'Cache'      =&gt; Illuminate\Support\Facades\Cache::class,
          'Config'     =&gt; Illuminate\Support\Facades\Config::class,
          'Cookie'     =&gt; Illuminate\Support\Facades\Cookie::class,
          'Crypt'      =&gt; Illuminate\Support\Facades\Crypt::class,
          'DB'         =&gt; Illuminate\Support\Facades\DB::class,
          'Eloquent'   =&gt; Illuminate\Database\Eloquent\Model::class,
          'Event'      =&gt; Illuminate\Support\Facades\Event::class,
          'File'       =&gt; Illuminate\Support\Facades\File::class,
          'Gate'       =&gt; Illuminate\Support\Facades\Gate::class,
          'Hash'       =&gt; Illuminate\Support\Facades\Hash::class,
          'Input'      =&gt; Illuminate\Support\Facades\Input::class,
          'Inspiring'  =&gt; Illuminate\Foundation\Inspiring::class,
          'Lang'       =&gt; Illuminate\Support\Facades\Lang::class,
          'Log'        =&gt; Illuminate\Support\Facades\Log::class,
          'Mail'       =&gt; Illuminate\Support\Facades\Mail::class,
          'Password'   =&gt; Illuminate\Support\Facades\Password::class,
          'Queue'      =&gt; Illuminate\Support\Facades\Queue::class,
          'Redirect'   =&gt; Illuminate\Support\Facades\Redirect::class,
          'Redis'      =&gt; Illuminate\Support\Facades\Redis::class,
          'Request'    =&gt; Illuminate\Support\Facades\Request::class,
          'Response'   =&gt; Illuminate\Support\Facades\Response::class,
          'Route'      =&gt; Illuminate\Support\Facades\Route::class,
          'Schema'     =&gt; Illuminate\Support\Facades\Schema::class,
          'Session'    =&gt; Illuminate\Support\Facades\Session::class,
          'Storage'    =&gt; Illuminate\Support\Facades\Storage::class,
          'URL'        =&gt; Illuminate\Support\Facades\URL::class,
          'Validator'  =&gt; Illuminate\Support\Facades\Validator::class,
          'View'       =&gt; Illuminate\Support\Facades\View::class,
          'Datatables' =&gt; yajra\Datatables\Datatables::class,
  
      ],
  
  ];
  </code></pre>
  
  <p>And this is Structure of <strong>yajra</strong> in <strong>vendor</strong> composer folder:</p>
  
  <p><a href="https://i.stack.imgur.com/fRlLZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fRlLZ.png" alt="enter image description here"></a></p>
  
  <p>But when I open <strong>postsData</strong> path in browser this error shown:</p>
  
  <pre><code>ReflectionException in Container.php line 737:
  Class datatables does not exist
  </code></pre>
  
  <p>What is Problem?</p>