If you are using post as a model (without dependency injection), you can also do:
$posts = Post::orderBy('id', 'DESC')->get();
More Related Contents:
- Laravel Check If Related Model Exists
- How to alias a table in Laravel Eloquent queries (or using Query Builder)?
- Laravel Eloquent: How to order results of related models?
- How to set a default attribute value for a Laravel / Eloquent model?
- Laravel Eloquent – Attach vs Sync
- How to create a subquery using Laravel Eloquent?
- Update without touching timestamps (Laravel)
- Eloquent model mass update
- How can I query raw via Eloquent?
- Find or Create with Eloquent
- Laravel Many to many self referencing table only works one way
- How Can I Remove “public/index.php” in the URL Generated Laravel?
- Laravel Model with Two Primary Keys update [duplicate]
- Laravel eager loading with limit
- Laravel pagination pretty URL
- Laravel OrderBy relationship count
- How to change / Custom password field name for Laravel 4 and Laravel 5 user authentication [duplicate]
- Laravel mail: pass string instead of view
- Laravel – Database, Table and Column Naming Conventions?
- Friendship system with Laravel : Many to Many relationship
- How to Merge Two Eloquent Collections?
- Laravel and view caching in development — can’t see changes right away
- Laravel 4.1: How to paginate eloquent eager relationship?
- Laravel Eloquent: How to get only certain columns from joined tables
- Laravel Eager Loading – Load only specific columns
- Laravel catch Eloquent “Unique” field error
- How to get last insert id in Eloquent ORM laravel
- How Can I Remove “public/index.php” in the Laravel Url generated? [duplicate]
- Merge ‘with’ and ‘whereHas’ in Laravel 5
- Laravel quick start guide route not working