I can not include a form in laravel

0

I try to include a form external to my page with the following code and I do not get it.

<?php include('resources/views/cuentas/clientes/form_natural.php'); ?>

I get the following error:

  

ErrorException in e142493e739d809fa1fc8b91d876e4c6d92279b2.php line   39: include (resources / views / accounts / clients / form_natural.php): failed   to open stream: No such file or directory (View:   /Applications/MAMP/htdocs/juntaAgua/resources/views/cuentas/clientes/create.blade.php)

This is the tree of my project:

Also try with the @include('') method that laravel offers and nothing.

Form that I try to include form_natural.php

<div id="form_natural">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Formulario de registro de un cliente natural</h3>
        </div>
        <div class="panel-body">
            <div class="panel-body">
                <div class="col-lg-8">

                    <div class="form-group">
                        <input type="hidden" disabled class="form-control" name="razon_social" value="natural"
                               placeholder="Numero de cédula...">
                    </div>
                    <div class="form-group">
                        <label for="cedula">Numero de cédula</label>
                        <input type="number" class="form-control" name="cedula" value="{{old('cedula')}}"
                               placeholder="Numero de cédula...">
                    </div>
                </div>
                <div class="col-lg-8">
                    <div class="form-group">
                        <label for="nombre">Nombre</label>
                        <input type="text" class="form-control" id="" placeholder="Nombre..." name="nombre"
                               value="{{old('nombre')}}">
                    </div>
                </div>
                <div class="col-lg-8">
                    <div class="form-group">
                        <label for="direccion">Dirección</label>
                        <input type="text" class="form-control" id="" placeholder="Dirección..." name="direccion"
                               value="{{old('direccion')}}">
                    </div>
                </div>
                <div class="col-lg-8">
                    <div class="form-group">
                        <label for="telefono">Teléfono</label>
                        <input type="text" class="form-control" id="" placeholder="Teléfono..." name="telefono"
                               value="{{old('telefono')}}">
                    </div>
                </div>
                <div class="col-lg-8">
                    <div class="form-group">
                        <label for="nombre">Correo</label>
                        <input type="text" class="form-control" id="" placeholder="Correo..." name="correo"
                               value="{{old('correo')}}">
                    </div>
                </div>


            </div>
        </div>
        <div class="panel-footer">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <button type="reset" name="button" class="btn btn-default"><i class="fa fa-eraser"></i>&nbsp;Limpiar
            </button>
            <button type="submit" name="button" class="btn btn-success"><i class="fa fa-save"></i>&nbsp;Guardar
            </button>
        </div>
    </div>
</div>
    
asked by jeancarlos733 11.03.2017 в 06:31
source

2 answers

0

Try using app_path ()

include(app_path() . '\resouces\views\cuentas\clientes\form_natural.php');

Update:

The problem was solved with the use of @include

@include('cuentas.clientes.form_natural');
    
answered by 11.03.2017 / 09:51
source
0

you're supposed to have it in the same folder so you do not have to do all that extension just to do this ... well, that's what I do.

<?php include 'form_natural.php'; ?>

or

<?php include "form_natural.php"; ?>
    
answered by 11.03.2017 в 07:09