Sinnbeck

Sinnbeck

Programmer at Aalund

Member Since 5 Years Ago

Hadsten

Experience Points
760,190
Total
Experience

0 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
171
Lessons
Completed
Best Reply Awards
1179
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.

Level 50
760,190 XP
Oct
30
19 hours ago
Activity icon

Awarded Best Reply on I Am Getting Error While Using Chatify Package

Be aware that the package might not be production ready https://github.com/munafio/chatify/issues/29

Activity icon

Replied to I Am Getting Error While Using Chatify Package

Be aware that the package might not be production ready https://github.com/munafio/chatify/issues/29

Activity icon

Replied to How To Run Node Js Server Using Exec In Laravel.

Just curios. What are you trying to do?

Activity icon

Replied to How To Run Node Js Server Using Exec In Laravel.

Does it work if you just run it on the terminal?

Activity icon

Replied to Chart In Laravel 8x Jetstream Livewire Tailwind

You named the route livewire.dashboard

Activity icon

Replied to My .htaccess Keep Changing On Server Even Though I Added It To Gitignore File

  1. Run the command
git rm --cached public/.htaccess
  1. Commit and push
  2. Make a backup of the htaccess on production
  3. Pull on production
  4. Put htaccess file in public (it is now gone)
Activity icon

Replied to Too Few Arguments To Function App\Http\Controllers\Admin\CommentController::accept(), 1 Passed And Exactly 2 Expected

Well new error. You dont have a method called updateStatus() on the App\Comment model

Activity icon

Replied to Uploading Data Via Deploy.sh To The Server (SSH Not Available)

Why not ask the other people how to initialize it properly?

Activity icon

Replied to Too Few Arguments To Function App\Http\Controllers\Admin\CommentController::accept(), 1 Passed And Exactly 2 Expected

If my above code does not work, please post your Javascript, that sends the data

Activity icon

Replied to Chart In Laravel 8x Jetstream Livewire Tailwind

Do you have such a model? If not, where are you getting the error?

Activity icon

Replied to Chart In Laravel 8x Jetstream Livewire Tailwind

What error? Is dashboard a livewire component?

Activity icon

Replied to Too Few Arguments To Function App\Http\Controllers\Admin\CommentController::accept(), 1 Passed And Exactly 2 Expected

You aren't sending any status in the url?

Is it sent as data?

public function accept(Comment $comment , Request $request)
    {
        if($comment->updateStatus( $comment , 'accept')){
            Comment::where('id' , $comment)->update(['status' , $request->status]);  
            return AjaxResponse::success();
        }
    }
Activity icon

Replied to Uploading Data Via Deploy.sh To The Server (SSH Not Available)

Well first it pushes your changes (I assume you have committed them). The it pushes your tags (if any are set.. These are used or versioning). Lastly it uploads your data. As you can't show the Phar, I don't know how.

And it most likely won't work on plain windows, but you can just install Ubuntu using wsl2, if it fails

Activity icon

Replied to Chart In Laravel 8x Jetstream Livewire Tailwind

Route::middleware(['auth:sanctum', 'verified'])->get('/', Dashboard::class)->name('livewire.dashboard');
Activity icon

Replied to My .htaccess Keep Changing On Server Even Though I Added It To Gitignore File

You probably added it to git before ignoring it. git remembers this

git rm --cached <file>

Be aware that it will remove the file completely on production on next pull, so make a backup!

Activity icon

Replied to Livewire Component Created After User Click

How about hiding the content using a class. And then when you click the button you change the state of a public property ($this->showData = true) inside the component class. Or a simple @if statement to hide it?

The button can also load the data and put it on a public property

The button will of course need to be inside the component for this solution to work :)

Activity icon

Replied to Adding ?tab=xyz To A Return View('contact.create',compact('vars'));

I assume you call this 'link' somewhere?

'link'              => route('contact::create', ['tab' => 'xyz']),

This will add `?tab='xyz' to the url

Activity icon

Replied to Adding ?tab=xyz To A Return View('contact.create',compact('vars'));

You are returning html, not redirecting. You need to add that in the code where you point to this page :) How does the user get here?

Activity icon

Replied to Pivot Table Woes.

@rodrigo.pedra Oh no I am only messing around. You are always one the kindest people in here, so no offence taken at all :)

Activity icon

Replied to LDAPRecord Laravel Integration

Well it first of uses the credentials you supplied to do the lookup. If a user is logging in, then that user does not query the AD him/herself. It is always the ldap account that you have added in config, that does the query. The same for import.

This is how I got mine working (the user is a special account made for only this purpose. It is only part of "Domain Users" group)

LDAP_CONNECTION=default
[email protected]
LDAP_PASSWORD=password
LDAP_PORT=389
LDAP_BASE_DN="dc=myactivedirectorydomain,dc=com"
Activity icon

Replied to Tailwind Css Not Working In Laravel

Is the css file loaded anywhere? I dont see that view extend a layout?

Activity icon

Replied to Jquery-2.1.1.js:4 GET Http://127.0.0.1:8000/productsCat?cat_id=2&price=500-1000 500 (Internal Server Error)

How about pasting you current version, and I will have a look for errors in it again.

Activity icon

Replied to Pivot Table Woes.

@rodrigo.pedra Sorry :) Will let you reply to the next one

Activity icon

Replied to Pivot Table Woes.

Ah sorry. Hard to remember all of them ;) Updated the answers with the correct method name

Activity icon

Awarded Best Reply on Pivot Table Woes.

Here you have increments()

Schema::create('contact_estimate', function (Blueprint $table) {
            $table->integer('contact_id')->unsigned()->index();

And here you have bigIncrements()

Schema::create('contacts', function (Blueprint $table) {
            $table->bigIncrements('id');

The data type needs to be exactly the same

Schema::create('contact_estimate', function (Blueprint $table) {
            $table->unsignedBigInteger('contact_id')->unsigned()->index();
Activity icon

Replied to Adldap2-Laravel With Windows Active Directory

Please create a new thread, so we can give you some help :) Install the above package and describe your problems in a new thread.

Activity icon

Replied to Pivot Table Woes.

bigIncrements is a bigUnsignedInteger :)

Schema::create('contact_estimate', function (Blueprint $table) {
            $table->unsignedBigInteger('contact_id')->unsigned()->index();
Activity icon

Replied to Pivot Table Woes.

Here you have increments()

Schema::create('contact_estimate', function (Blueprint $table) {
            $table->integer('contact_id')->unsigned()->index();

And here you have bigIncrements()

Schema::create('contacts', function (Blueprint $table) {
            $table->bigIncrements('id');

The data type needs to be exactly the same

Schema::create('contact_estimate', function (Blueprint $table) {
            $table->unsignedBigInteger('contact_id')->unsigned()->index();
Activity icon

Replied to Jquery-2.1.1.js:4 GET Http://127.0.0.1:8000/productsCat?cat_id=2&price=500-1000 500 (Internal Server Error)

Can you see in the stack trace where the error comes from?

And you can try fixing the product count like this (if that is the issue)

$priceCount = count($request->input('price', []);
Activity icon

Replied to Jquery-2.1.1.js:4 GET Http://127.0.0.1:8000/productsCat?cat_id=2&price=500-1000 500 (Internal Server Error)

As count 0 is false and null is false, this should be

if(!$data){
          echo "<h1 align='center'>no products found under this Category</h1>";
        }else{
        return view('frontEnd.produt-category',[
          'data' => $data, 'catByUser' => $data[0]->cat_name
        ]);
Activity icon

Replied to Disable Button 1 Day Laravel

Sorry but can you try to explain a bit more? Should a user only be allowed to click that button once a day?

If that is what you mean you could save it to the database (save the user_id and a datetimestamp). The on the page, check if there is a record for the user in that table. And then add a scheduled task that runs every 5 minutes, to remove records that are older than 24 hours.

Activity icon

Replied to Jquery-2.1.1.js:4 GET Http://127.0.0.1:8000/productsCat?cat_id=2&price=500-1000 500 (Internal Server Error)

You can ensure that they dont fail (null isnt countable)

$priceCount = count($request->price ?? []);

//and
if(count($data ?? [])=="0"){
Activity icon

Replied to A Relationship Of A Table With Itself

Can a subitem have many parent items as well? If not, it isnt a many to many but a one to many

If it is just a tree structure (one to many and deep), you can use this package. I use it myself: https://github.com/lazychaser/laravel-nestedset

Activity icon

Replied to Null When I Dd

@snapey Absolutely.. I am psychic after all! :)

Activity icon

Replied to Chart In Laravel 8x Jetstream Livewire Tailwind

https://github.com/asantibanez/livewire-charts

You could also try this package if the design is ok for you :)

Activity icon

Replied to Null When I Dd

That $slug wasn't in the question? I think you answered something different that you asked :)

Activity icon

Replied to Null When I Dd

So the "slug" is just "1" ?

If you are trying to get it by id you need to tell it that

$catname = ProductCategory::where('id', $cat)->first();
dd($catname);
Activity icon

Replied to Throwing ThrottleRequestsException But No Retry-After And X-RateLimit-Reset Headers On Response

Ah check. Just looked through the source of laravel itself and tried finding the same in lumen, so I might have missed it by a little :) Great that you got it working

Activity icon

Awarded Best Reply on Throwing ThrottleRequestsException But No Retry-After And X-RateLimit-Reset Headers On Response

Try checking what it is getting here

https://github.com/laravel/lumen-framework/blob/8.x/src/Exceptions/Handler.php#L105

This response might not include the headers. You could add something like this to your own exception handler?

if ($e instanceof HttpResponseException) {
  $response = $e->getResponse();
  $response->headers->add($e->getHeaders()));
  return $response;
}
Activity icon

Replied to Migration Does Not Change Column Name

Well it will run the schema part as a transaction, so I would assume that the actual renaming isn't commited when you run the update.

Try my example and see if that work.

Activity icon

Replied to Migration Does Not Change Column Name

You could try splitting it

public function up()
{
	Schema::table( 'blog_posts', function ( Blueprint $table )
	{
		$table->renameColumn('image', 'image_id'); 
		$table->unsignedInteger('image_id')->change();

	});

       Schema::table( 'blog_posts', function ( Blueprint $table )
	{
		DB::statement('UPDATE `blog_posts` SET `image_id` = NULL where `image_id` = 261');  // ERROR
		$table->foreign('image_id')->references('id')->on('files');
	});
}
Activity icon

Replied to Throwing ThrottleRequestsException But No Retry-After And X-RateLimit-Reset Headers On Response

Try checking what it is getting here

https://github.com/laravel/lumen-framework/blob/8.x/src/Exceptions/Handler.php#L105

This response might not include the headers. You could add something like this to your own exception handler?

if ($e instanceof HttpResponseException) {
  $response = $e->getResponse();
  $response->headers->add($e->getHeaders()));
  return $response;
}
Activity icon

Replied to Throwing ThrottleRequestsException But No Retry-After And X-RateLimit-Reset Headers On Response

Sorry I must be blind today :D

I agree. Use xdebug to step through :)

Activity icon

Replied to Jetstream/Livewire 2 - Undefined Variable: Header

I assume you are using that component directly from the route?

<?php

namespace App\Http\Livewire\Entity;

use App\Models\Entity;
use Livewire\Component;

class Index extends Component
{
    public $columns = [];
    public $items = [];
    public $header = 'My title'; //added a header variable

    public function mount() {
        $this->columns = [
            'name' => [
                'field' => 'name',
                'label' => 'Nome'
            ]
        ];

        $this->items = Entity::all();
    }

    public function render()
    {
        return view('livewire.entity.index');
    }
}

Edit: Missed the <x-slot name="header">

Activity icon

Replied to Throwing ThrottleRequestsException But No Retry-After And X-RateLimit-Reset Headers On Response

What do you get if you dd before the return ?

dd($reponse->headers);
return $response;
Activity icon

Replied to Is There Better Alternative To Laravel

@melewa If you have been using laravel for 4 years, it should be quite easy to just ignore jetstream and install laravel/ui as usual. Jetstream is something you can choose to use, but you don't have to. I honestly don't see how an extra option can make it a bad framework?