Move Models into app/Models
This commit is contained in:
parent
09d3d0fee2
commit
e5cae87c04
12 changed files with 51 additions and 31 deletions
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Aliments extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'aliments';
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Moba;
|
||||
use App\Models\Moba;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ImportMoba extends Command
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Moba;
|
||||
use App\Models\Moba;
|
||||
|
||||
class MajEleveurs extends Command
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\MiseEnPlace;
|
||||
use App\Aliments;
|
||||
use App\Eleveur;
|
||||
use App\Moba;
|
||||
use App\Models\MiseEnPlace;
|
||||
use App\Models\Aliment;
|
||||
use App\Models\Eleveur;
|
||||
use App\Models\Moba;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class AjaxController extends Controller
|
||||
|
|
@ -33,7 +33,7 @@ class AjaxController extends Controller
|
|||
$date = $y . '-' . $m . '-' . $d;
|
||||
$aliment = $data[2];
|
||||
|
||||
$alim = new Aliments();
|
||||
$alim = new Aliment();
|
||||
$alim->code_lot = $codeLot;
|
||||
$alim->date_livraison = $date;
|
||||
$alim->type_aliment = $aliment;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Eleveur;
|
||||
use App\Models\Eleveur;
|
||||
use App\Http\Requests\MyRequest;
|
||||
use Response;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Eleveur;
|
||||
use App\Aliments;
|
||||
use App\MiseEnPlace;
|
||||
use App\Moba;
|
||||
use App\Models\Eleveur;
|
||||
use App\Models\Aliment;
|
||||
use App\Models\MiseEnPlace;
|
||||
use App\Models\Moba;
|
||||
use App\VisuelLibelle;
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ class FrontController extends Controller
|
|||
|
||||
$mep = MiseEnPlace::whereIn('eleveurId_pondeuse', $elevId)->where('date_transfert_poulettes', '<', $datePonte)->orderBy('id', 'DESC')->first();
|
||||
if ($mep) {
|
||||
$aliment = Aliments::where('code_lot', $mep->code_lot_pondeuse)->orderBy('id', 'DESC')->first();
|
||||
$aliment = Aliment::where('code_lot', $mep->code_lot_pondeuse)->orderBy('id', 'DESC')->first();
|
||||
} else {
|
||||
$mep = '';
|
||||
$aliment = "";
|
||||
|
|
|
|||
15
app/Models/Aliments.php
Normal file
15
app/Models/Aliments.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Aliment extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
|
@ -9,6 +9,11 @@ class Eleveur extends Model
|
|||
{
|
||||
use SoftDeletes;
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
|
|
@ -44,9 +49,19 @@ class Eleveur extends Model
|
|||
*/
|
||||
protected $table = 'eleveurs';
|
||||
|
||||
/**
|
||||
* The accessors to append to the model's array form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $appends = ['questions'];
|
||||
|
||||
public function getQuestionsAttribute()
|
||||
/**
|
||||
* Questions attribute accessor
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getQuestionsAttribute(): bool
|
||||
{
|
||||
if ($this->aboutyou != null && $this->aboutyou != '') {
|
||||
return true;
|
||||
|
|
@ -1,11 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MiseEnPlace extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
Loading…
Add table
Reference in a new issue