mercredi 1 février 2017

Class 'Model' not found in Laravel

I wanna make a custom Class, because I wanna fill it with some data, the class doesn't match with any of my table so this is the reason that I make a custom Class.

I have the following error:

Class 'Model' not found in Turno.php line 2

I declarated the same "use" like my another models. May be is not the way to declare a Class like I want.

Turno.php

<?php

namespace App;
use Illuminate\Database\Eloquent\Model;

class Turno extends Model
{
    var $hora;
    var $canchaFK;
    var $fecha;
    var $fechaDeReserva;
    var $nombre;
    var $email;
    var $telefono;
    var $estado;
    var $baneado;
    var $vencido;
    var $turnoFijo;

    function __construct(){ 
        $a = func_get_args(); 
        $i = func_num_args(); 
        if (method_exists($this,$f='__construct'.$i)) { 
            call_user_func_array(array($this,$f),$a); 
        } 
    } 
    function __construct8($hora, $canchaFK, $fecha, $fechaDeReserva, $nombre, $email, $telefono, $estado){
        $this->hora = $hora;
        $this->canchaFK = $canchaFK;
        $this->fecha = $fecha;
        $this->fechaDeReserva = $fechaDeReserva;
        $this->nombre = $nombre;
        $this->email = $email;
        $this->telefono = $telefono;
        $this->estado = $estado;
        $this->baneado = false;
        $this->vencido = false;
        $this->turnoFijo = false;
    }
    function __construct7($hora, $canchaFK, $fecha, $fechaDeReserva, $nombre, $email, $telefono){
        $this->hora = $hora;
        $this->canchaFK = $canchaFK;
        $this->fecha = $fecha;
        $this->fechaDeReserva = $fechaDeReserva;
        $this->nombre = $nombre;
        $this->email = $email;
        $this->telefono = $telefono;
        $this->baneado = false;
        $this->vencido = false;
        $this->turnoFijo = false;
    }
    function sethora($hora){
        $this->hora = $

    ...
}

I have an api with plain text that use this Class. Now with Laravel I need the same class to work with the same code, but now with a Controller.

Thanks for help!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kTPBFV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire