title: PHPStorm is not recognizing methods of my Model class in Laravel 5.0
body: <p>failed insert data into database, and all query class and Model class's method not found show in IDE (phpStrom) how can I solve it? </p>
  
  <p>here is my extended class (Post.php) here show error in latest and where method:</p>
  
  <pre><code>&lt;?php namespace App;
  
  use Carbon\Carbon;
  use Illuminate\Database\Eloquent\Model;
  
  class Post extends Model {
  
      protected  $fillable=[
          'title',
          'description',
          'location',
          'contact',
          'type',
          'published_at'
      ];
      protected $date=['published_at'];
      public function setPublishedAtAttribute($date)
      {
          $this-&gt;attributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date);
      }
  
      /**
       * @param $query
       */
      public function scopePublished($query)
      {
          $query-&gt;where('published_at', '&lt;=', Carbon::now());
      }
  
      public function scopeUnPublished($query)
      {
          $query-&gt;where('published_at', '&gt;=', Carbon::now());
      }
  
      /**
       * An post is owned by a user.
       * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
       */
      public function user(){
          return $this-&gt;belongsTo('App\User');
      }
  
  } 
  </code></pre>
  
  <p>and Here is my Controller class where i use it : </p>
  
  <pre><code>&lt;?php namespace App\Http\Controllers;
  
  use App\Http\Requests;
  
  use App\Http\Requests\CreatePostRequest;
  use App\Post;
  use Request;
  use Illuminate\Support\Facades\Auth;
  use Session;
  
  class PostsController extends Controller {
  
      //
      public function __construct()
      {
          $this-&gt;middleware('auth');
      }
  
      public function index()
      {
          //return \Auth::user()-&gt;name;
          $posts = Post::latest('published_at')-&gt;published()-&gt;get();
          $latest= Post::latest()-&gt;first();
          return view('tolet.index', compact('posts','latest'));
  
      }
  
      /**
       * @param Post $post
       * @return \Illuminate\View\View
       * @internal param Articles $article
       * @internal param Articles $articles
       */
      public function show(Post $post)
      {
  
          return view('tolet.show', compact('post'));
      }
  
      public function create()
      {
          if (Auth::guest()) {
              return redirect('tolet.index');
          }
          return view('tolet.create');
      }
  
      /**
       * @param CreatePostRequest $request
       * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
       */
      public function store(CreatePostRequest $request)
      {
          //validation
  
          $this-&gt;createPost($request);
  
  
         // flash('Your tolet has been created!')-&gt;important();
  
          return redirect('tolet.index');
      }
  
      /**
       * @param Post $post
       * @return \Illuminate\View\View
       * @internal param Articles $article
       */
      public function edit(Post $post)
      {
          return view('tolet.edit', compact('post'));
      }
  
  
      /**
       * @param Post $post
       * @param CreatePostRequest $request
       * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
       * @internal param Articles $article
       * @internal param $id
       */
      public function update(Post $post, CreatePostRequest $request)
      {
          $post-&gt;update($request-&gt;all());
          return redirect('tolet.index');
      }
  
      /**
       * sync up the list of tags in the database
       *
       * @param Post $post
       */
  
  
      /**
       * save a new post
       *
       * @param CreatePostRequest $request
       * @return mixed
       */
      private function createPost(CreatePostRequest $request)
      {
          $post = Auth::user()-&gt;posts()-&gt;create($request-&gt;all());
  
          return $post;
      }
  
  
  }
  </code></pre>