codinglara

Member Since 9 Months Ago

Experience Points
1,170
Total
Experience

3,830 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 your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

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

Level 1
1,170 XP
Feb
23
3 days ago
Activity icon

Replied to Undefined Variable: Categories

How do I disable cache routing during development?

Activity icon

Awarded Best Reply on Undefined Variable: Categories

I fixed the routing problem. I didn't clear the route cache and that was the issue.

Activity icon

Replied to Undefined Variable: Categories

I fixed the routing problem. I didn't clear the route cache and that was the issue.

Activity icon

Replied to Undefined Variable: Categories

There's no typo. I am extending a layout.

@extends('layouts.app')

Activity icon

Started a new Conversation Undefined Variable: Categories

I am trying to retrieve categories from database and show them on my index page but I get this error. I used factories to store some dummy data in my database.

Here's the model (empty at the moment).

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
    use HasFactory;
}

controller

<?php

namespace App\Http\Controllers;

use App\Models\Category;
use Illuminate\Http\Request;

class CategoryController extends Controller
{
    public function index(){
        $categories = Category::all();
        return view('index', ['categories' => $categories]);
    }
}

the route

Route::get('/', [\App\Http\Controllers\CategoryController::class, 'index']);

and the view

 <div class="w-full flex flex-col lg:flex-row flex-wrap items-center padding">
                @foreach($categories as $category)
                <div class="w-full lg:w-1/4 mb-5 lg:mb-10">
                    <div class="py-5 px-10 shadow-none flex flex-col rounded-3xl items-center border-2 border-transparent border-solid hover:shadow-2xl hover:border-0 hover:border-t-4 hover:border-blue-default">
                        <span class="align-middle px-5 text-blue-link mt-5 mb-5 text-3xl"><i class="fi fi-holiday-village"></i></span>
                        <h3 class="h3 md:text-center"><a href="">{{ $category->name }}</a></h3>
                    </div>
                </div>
                @endforeach
            </div>
Feb
21
5 days ago
Activity icon

Replied to Route Not Defined

Thank you.

Activity icon

Started a new Conversation Route Not Defined

I am not sure what could be the problem, I get this error

Route [kontakt] not defined.

web.php

Route::get('/kontakt', function () {
    return view('contact')->name('kontakt');
});

I addressed the route in my header file like this:

            <li><a href="{{ route('kontakt') }}" class="text-gray-100 text-sm tracking-wider">Kontakt</a></li>


I ran

php artisan route:list

And the route is defined.

I also cleared the route cache.

php artisan route:cache
Feb
14
1 week ago
Activity icon

Started a new Conversation Laravel Doesn't Load Tailwind Styles

Laravel doesn't load Tailwind styles on a fresh installation.

I installed Tailwind via NPM and created my config file tailwind.config.js

module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}

I added the following code to my resources/app.css

@tailwind base;
@tailwind components;
@tailwind utilities;

Also, my webpack.mix.js file looks like this

  mix.js("resources/js/app.js", "public/js")
    .postCss("resources/css/app.css", "public/css", [
     require("tailwindcss"),
    ]);

I also included the stylesheet in my main layout

   <link href="{{ asset('css/app.css') }}" rel="stylesheet">

I didn't get any errors when running

npm install
npm run dev

Let's say I created a simple div like this

<div class ="bg-red-500">
...
</div>

The code will be loaded but the class won't be applied to my div.

Jan
11
1 month ago
Activity icon

Awarded Best Reply on SQLSTATE Column Not Found

I made a stupid mistake, it was a typo. But thank you, I also needed to load the posts.

Route::get('/users/{user::username}/posts', [UserPostController::class, 'index'])->name('users.posts');
Route::get('/users/{user:username}/posts', [UserPostController::class, 'index'])->name('users.posts');
Activity icon

Replied to SQLSTATE Column Not Found

I made a stupid mistake, it was a typo. But thank you, I also needed to load the posts.

Route::get('/users/{user::username}/posts', [UserPostController::class, 'index'])->name('users.posts');
Route::get('/users/{user:username}/posts', [UserPostController::class, 'index'])->name('users.posts');
Activity icon

Started a new Conversation SQLSTATE Column Not Found

I am trying to access the view where I can see all posts made by a single user. And this is the error I get.

SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause' (SQL: select * from users where `` = 6 limit 1)

I ran the migrations again and there's nothing to migrate, the column is in the table.

Here's the User Model

<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use HasFactory, Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
        'email',
        'password',
        'username'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];

    public function posts(){
        return $this->hasMany(Post::class);
    }

    public function likes(){
        return $this->hasMany(Like::class);
    }
}

username migration

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddUsernameToUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('username');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('username');
        });
    }
}

And the route

Route::get('/users/{user::username}/posts', [UserPostController::class, 'index'])->name('users.posts');

I want the route to be like "users/username/posts".

When I do something like

Route::get('/users/{user}/posts', [UserPostController::class, 'index'])->name('users.posts');

I get something like this "users/6/posts" and that's not what I need.

Here's the view users.posts.index

@extends('layouts.app')

@section('content')
    <div class="flex justify-center">
        <div class="w-8/12 bg-white p-6 rounded-lg">
            {{ $user->name }}
        </div>
    </div>
@endsection

And the controller

namespace App\Http\Controllers;

use App\Models\User;
use Illuminate\Http\Request;

class UserPostController extends Controller
{
    public function index(User $user){
        //dd($user);
        return view('users.posts.index', [
           'user' => $user,
        ]);
    }
}
Dec
26
2 months ago
Activity icon

Awarded Best Reply on Tailwind Npm Run Dev Error

Solved this issue by updating nodejs to 14.x

Activity icon

Replied to Tailwind Npm Run Dev Error

Solved this issue by updating nodejs to 14.x

Activity icon

Started a new Conversation Tailwind Npm Run Dev Error

Tailwind CSS is not generating because I can't run

npm run dev

I followed the steps explained in laravel.com/docs/8.x/mix#tailwindcss documentation but I get the following error every time I run the command.

ERROR in ./resources/css/app.css
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: getProcessedPlugins is not a function

My resources/css/app.css file looks like this

@tailwind base;
@tailwind components;
@tailwind utilities;

Sep
13
5 months ago
Activity icon

Replied to Laravel 7 Vs Laravel 8 Dilemma

@snapey I appreciate your opinion but there's no need to be rude.

Sep
10
5 months ago
Activity icon

Started a new Conversation Laravel 7 Vs Laravel 8 Dilemma

Is it smart to work on new projects but use v7? I started learning Laravel 7 a few months ago and I got used to it, still have a lot of things to learn, I am having trouble understanding all the changes in v8.

I've been using Bootstrap and SASS for years now, so I am already having some issues with v8 because Laravel UI is dropped. I am not familiar with Tailwind CSS, also Livewire and Inertia seem complicated for me at the moment. Is Livewire (or Inertia) necessary or it's just an option? How to use Bootstrap in v8? What's the best practice for using Bootstrap in v8? Is it better to just learn and use Tailwind instead? I tried running these commands

composer require laravel/ui
php artisan ui bootstrap

but I have problems when I run

php artisan ui bootstrap --auth

because it's not working in v8.

Sep
09
5 months ago
Activity icon

Replied to Laravel 8 "Target Class [Auth\LoginController] Does Not Exist."

It's probably a stupid questions but can you still use Bootstrap in v8? And how? I am not familiar with Tailwind, so I tried to run these commands

composer require laravel/ui

and

php artisan ui bootstrap

and

php artisan ui bootstrap --auth

but it didn't work because v8 is now using jetstream.

Activity icon

Replied to Laravel 8 DB Exception After Installing Jetstream

I had the same problem, I updated variables in my .env file and then ran migrations and it worked.