Cyanide
1 week ago

Use of undefined constant admin - assumed 'admin'

Posted 1 week ago by Cyanide

i have a problem when i want enter a route to index as inicio, says that use of undefined constant admin , but i don't have this constant , just want enter to a route inner to folder admin/products.. this was when i been tried uses messages with variable @Session.. have any solution?

here the error ...

ErrorException (E_ERROR) Use of undefined constant admin - assumed 'admin' (this will throw an Error in a future version of PHP) (View: C:\xampp\htdocs\proyecto\resources\views\admin\products\inicio.blade.php) Previous exceptions Use of undefined constant admin - assumed 'admin' (this will throw an Error in a future version of PHP) (0)

this is my code index.blade as to inicio.blade

extends('layouts.app')

@section('title', 'Productos (listado de productos)') @section('content')

Listado de productos

Nuevo producto Id Nombre DescripciĆ³n Categoria Precio al detalle Precio de compra Precio por mayor Acciones
          </tr>
        </thead>
        <tbody>
          @foreach ($products as $product)
          <tr>
            <th scope="row">{{ $product->id }}</th>
            <td class="col-md-2">{{ $product->name}}</td>
            <td class='text-right col-md-2'>{{ $product->description}}</td>
            <td>{{ $product->category ? $product->category->name : 'General' }}</td>
            <td class='text-right col-md-1'>$ {{ $product->price }}</td>
            <td class='text-right col-md-1'>$ {{ $product->price_buy }}</td>
            <td class='text-right col-md-1'>$ {{ $product->price_major }}</td>
            <td class='text-right col-md-3'>
              <div class="btn-group" role="group" aria-label="Basic example">
                <button type="button" class="btn btn-info btn-sm" data-toggle="tooltip" data-placement="top" title="Ver producto">
                <i class="fa fa-search"></i>
                </button>
                <button type="button" class="btn btn-warning btn-sm" data-toggle="tooltip" data-placement="top" title="Editar producto">
                <i class="fa fa-pencil-square-o"></i>
                </button>
                <button type="button" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="top" title="Eliminar producto">
                <i class="fa fa-trash"></i>
                </button>
              </div>
            </td>
          </tr>
          @endforeach
        </tbody>
      </table>
      {{ $products->links() }}
    </div>
  </div>
</div>

@endsection

Please sign in or create an account to participate in this conversation.