Cyanide

Cyanide

Member Since 1 Week Ago

Experience Points 60
Experience Level 1

4,940 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

11 Sep
1 week ago

Cyanide left a reply on Use Of Undefined Constant Admin - Assumed 'admin'

here ProductController code

namespace App\Http\Controllers;

use App\Product; use Illuminate\Http\Request;

class ProductController extends Controller

{ public function index() { $products = Product::paginate(10); return view('admin.products.inicio')->with(compact('products')); // devolvera la vista del listado de productos }

public function create()
{
    return view('admin.products.create');   // devolvera el formulario de registro
}

public function store(Request $request) //inyecci├│n de dependencia de Laravel
{
    // registrar el nuevo producto a la bd

    //dd($request->all());

    $product = new Product();
    $product->name = $request->input('name');
    $product->description = $request->input('description');
    $product->price = $request->input('price');
    $product->price_buy = $request->input('price_buy');
    $product->price_major = $request->input('price_major');
    $product->long_description = $request->input('long_description');
    $product->save(); //realiza un insert sobre la tabla Product.

    return redirect('/admin/products');

}

}

Cyanide started a new conversation Use Of Undefined Constant Admin - Assumed 'admin'

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