0
I have a question at the moment of showing the post
user only who is logged in?
Man model
:
class propuestas extends Model
{
protected $fillable = ['titulo',
'descripcion',
'estado',
'linea_id',
'user_id'
];
public function user()
{
return $this->belongsTo(User::class);
}
public function linea()
{
return $this->belongsTo(Lineas::class);
}
}
Man controller
:
public function propuestas_index()
{
$this->middleware('auth');
//$this->middleware('isroot');
$propuestas = Propuestas::all();
$user = User::all();
$lineas = lineas::all();
return view('tutor.propuestastutor',
array(
'propuestas' => $propuestas,
'user' => $user,
'lineas' => $lineas
)
);
}
related: https://answall.com/questions/148776/para-que-serve-um-scope-no-laravel/151866#151866
– novic
related: https://answall.com/questions/274713/como-configurar-um-anonymous-global-scopes-no-laravel/274721#274721
– novic