how can i create a method in laravel in my USER controller that when i click on a button in the view it will download a txt file with this info tha its generating from this query
User::select('id','name','lastname')
->orderBy('id','desc')
->take(100)
->get();
Printing these 3 fields of Users table in 3 column in the txt file. If someone can guide me doing this via jquery-ajax it would be perfect !
UPDATED my problem is solved thanks to the guy below !