B
B
BonBon Slick2017-01-08 17:09:45
JavaScript
BonBon Slick, 2017-01-08 17:09:45

Automatic cleaning of the Database at the end of the timer?

I have a timer on the page, at the end, it should be updated, then send an Ajax request to the controller function, which will clear the database.

What to register in the controller?
How to clear the base?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mysterion, 2017-01-08
@BonBonSlick

routes.php
CleanController.php

public function clean() {
    DB::table('table')->truncate();
}

Well, there are all sorts of checks, of course. Whether it is possible to check ajax it is request or not.
if($request->ajax()) {
    // ajax-запрос
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question