What have I done wrong here? Is it how I've strung the query together? I have the below query:
$companies = Category::all()->groupBy('company')->OrderBy('company', 'asc');
Which results in the following error:
Method Illuminate\Database\Eloquent\Collection::OrderBy does not exist.
Have I just done it in the wrong order or something?