hjortur17

Hire Me

Experience

6,290

0 Best Reply Awards

  • Member Since 6 Months Ago
  • 55 Lessons Completed
  • 0 Favorites

25th April, 2018

hjortur17 left a reply on Delete Function Not Working • 3 weeks ago

I got it to work. Thanks for the help!

This was happening because I have all of this inside of a table. I had to move the form inside tag (It was at the bottom of the table)

Thanks again for all the help and suggestion!

24th April, 2018

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

Okay, so I added the button and it didn't work. I did debug it with onClick function and just print out in the console and that worked.

I also tried to make hidden input but that didn't work either

And I don't know about any Javascript files how is interacting with this site.

I also forgot to mention this delete method worked before ...

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

I changed that to

return redirect('/stjornbord/frettir');

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

Just returning an error

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

5.6.16

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

Still getting the same error

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

The DD worked (I did dd($thread) same as @devk suggested), and the result was:

#attributes: array:8 [▼
    "id" => 2
    "slug" => "Title 2"
    "user_id" => 1
    "title" => "Title 2"
    "body" => "https://nfs.test/stjornbord/frettir/eyda/1aas ads asd"
    "image" => "frettir/yeIIaCv1f9azslcsYwSDjnLVCGtu1Zb4kQsXG7gs.jpeg"
    "created_at" => "2018-04-24 08:59:59"
    "updated_at" => "2018-04-24 08:59:59"
  ]

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

Nope the buttons did not work (When clicked nothing happend)

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

@rin4ik didn't work :/

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

@devk this is the outcome:

| DELETE | stjornbord/frettir/eyda/{thread} | thread.delete | Closure | web

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

I tried @rin4ik idea about making function inside web.php but that did work

It will not display ok

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

The URL is /stjornbord/frettir/eyda/1 the ID of the thread

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

Route::delete('/stjornbord/frettir/eyda/{thread}', '[email protected]')->name('thread.delete');

hjortur17 left a reply on Delete Function Not Working • 4 weeks ago

Done, sorry about that

hjortur17 started a new conversation Delete Function Not Working • 4 weeks ago

Hi, I'm trying to delete thread with onClick function. But I get MethodNotAllowedHttpException error

My code is:

@csrf @method('DELETE')

And the controller looks like this:

public function destroy(Thread $thread) { $thread->delete(); return back(); }

14th April, 2018

hjortur17 left a reply on Failed To Deploy Because Of The Composer.lock File • 1 month ago

No local changes to save - why? I was make-ing changes to my controller

git add . git commit -m "More readable controller" git stash push

No local changes to save

hjortur17 left a reply on Failed To Deploy Because Of The Composer.lock File • 1 month ago

How does git stash works? Should I do git add . git commit git stash or?

hjortur17 started a new conversation Failed To Deploy Because Of The Composer.lock File • 1 month ago

Hi, I recently updated to Laravel 5.6 and when I push to GitHub the change go thru but Forge always come's up with an error

From github.com:Hjortur17/nfs

  • branch master -> FETCH_HEAD error: Your local changes to the following files would be overwritten by merge: composer.lock Please, commit your changes or stash them before you can merge. Aborting Updating 3376a21..ceece9e

11th April, 2018

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

It did to restart it

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

Thanks

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

No, when I try to use valet now to view my project it only displays h1 with the text: It works! and not the content from me.

Any ideas why that is?

So my project is inside of a folder called: websites I did valet park and then I did go to my project called nfs and did valet link and if I visit nfs.test it displays It works!

@rin4ik Any ideas why? Btw thank you very much for all your help!

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

The problem is fixed but now I'm having a problem with valet

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

Yes, and now only displaying It's work!

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

I have not made any changes. I'm trying to use Laravel Valet

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

@rin4ik Now I'm getting 502 Gateway. Any ideas why?

nginx/1.12.2

Ideas to fix?

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

@rin4ik Thanks a lot! Now it is up and running!

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

@rin4ik I tried but did fully understand it

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

Undefined class constant 'HEADER_CLIENT_IP'

Getting this error when trying that

hjortur17 left a reply on Upgrade-ing To Laravel 5.6 • 1 month ago

Still getting Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

hjortur17 started a new conversation Upgrade-ing To Laravel 5.6 • 1 month ago

I get an error when trying to do composer update

The error message is: Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

I change to "laravel/framework": "5.6.*" and "php": ">=7.2.4"

Any ideas how I can upgrade it?

7th April, 2018

hjortur17 left a reply on Publish A Laravel Project • 1 month ago

I did discover Forge and it's awesome! Thanks, everybody for the help!

hjortur17 left a reply on Image Store • 1 month ago

Thanks, everybody but @elcultivo had the right answer!

hjortur17 left a reply on Image Store • 1 month ago

@Snapey It didn't work

hjortur17 left a reply on Image Store • 1 month ago

@rin4ik It did work to create a public function inside Thread model but I post an error message but still save the Thread to the database.

Undefined variable: thread

hjortur17 left a reply on Image Store • 1 month ago

Now I'm getting Call to a member function storeAs() on null

hjortur17 left a reply on Image Store • 1 month ago

I don't understand :/ I have both 'image' => 'image|nullable' in my validation and also $table->string('image')->nullable(); in my migration

hjortur17 left a reply on Image Store • 1 month ago

I did $table->string('image')->nullable(); in my migration

hjortur17 left a reply on Image Store • 1 month ago

Still getting an error. Call to a member function store() on null

hjortur17 started a new conversation Image Store • 1 month ago

Hi, I have image upload on my website, I',m trying to make it possible to have it nullable. Any ideas?

This is my store function: public function store() { $this->validate(request(), [ 'title' => 'required|unique:threads|max:255', 'body' => 'required|min:20', 'image' => 'image|nullable' ]);

          Thread::create([
                 'title' => request('title'),
                 'user_id' => Auth::user()->id,
                 'body' => request('body'),
                 'image' => request()->file('image')->store('frettir', 'public'),
          ]);

          return redirect('/stjornbord')->with('flash', 'Fréttin var búin til!');
   }

And this is my migration: Schema::create('threads', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id'); $table->string('title'); $table->text('body'); $table->string('image')->nullable(); $table->timestamps(); });

6th April, 2018

hjortur17 left a reply on Storage Link • 1 month ago

Thanks! The last one worked!

hjortur17 left a reply on Storage Link • 1 month ago

Yes it did, but I'm trying to run threads with foreach and getting the image link thru database like:

hjortur17 started a new conversation Storage Link • 1 month ago

Hi, I have image upload on my website and when I upload an image it goes to the storage folder. I already tried to generate a link between the storage folder and the public folder with: php artisan storage:link but that didn't work. Any ideas?

4th March, 2018

hjortur17 left a reply on Help To Clean My Code • 2 months ago

Thanks for the tip

hjortur17 started a new conversation Help To Clean My Code • 2 months ago

Hi, any tips how to clean this code up? I'm useing this code 3-4 times in the same controller.

$threads = Thread::latest()->get();
$threadsCount = Thread::latest()->count();

$party = Party::latest()->get();
$partyCount = Party::latest()->count();
              
$users = User::latest()->get();
$userCount = User::latest()->count();

12th December, 2017

hjortur17 left a reply on Publish A Laravel Project • 5 months ago

@RamjithAp only the public folder or the whole project?

hjortur17 left a reply on Publish A Laravel Project • 5 months ago

It is public_html and yes I have SSH access

11th December, 2017

hjortur17 started a new conversation Publish A Laravel Website • 5 months ago

Hi, I did create my blog with Laravel and I'm having a difficult time figure out how to publish it with Hostgator. I already have domain and host plan with Hostagator.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.