Answer the question
In order to leave comments, you need to log in
Why session id from database is 0?
Hello!
I record my sessions in the database.
But when I want to get them
class sessions extends Model {
protected $table = 'sessions';
public function getAll() {
return $this->get()->toArray();
}
}
class testController extends Controller {
public function midd(Request $request) {
$x = new Sessions();
$c = $x->getAll();
print_r($c, 1);
}
}
$data = DB::table('sessions')->get();
Answer the question
In order to leave comments, you need to log in
Because you need to read the eloquent documentation, section “Primary keys”. And using the search is also very useful.
patamuzhda string id is pornography
class Flight extends Model
{
/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question