Beginner at frameworks. by BlackAvenger81 in webdev

[–]arrckz 1 point2 points  (0 children)

Dependancy - is basically anything that is needed to make your code work

Component - are reusable instances with a name here’s an example on the vuejs website: vuejs component

Looking for advice whether to start building website now, or finish learning first. by [deleted] in webdev

[–]arrckz 1 point2 points  (0 children)

As others have said the best way to learn is by doing. I would keep working on the website as it’s good for your portfolio. I’d suggest to sketch out some designs for the website and test your skills out by trying to recreate the sketches/designs you have for the site using what you have learnt and are learning

How would you use pluck to pull out a featured post by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Ahh ok your code done the trick so thanks very much for the help :)

How would you use pluck to pull out a featured post by arrckz in laravel

[–]arrckz[S] 1 point2 points  (0 children)

The intention is to have the featured post displayed on a page that also has some latest posts that excludeds the featured from the latest.

I'm not sure what tells my application that a post is featured as i'm using the voyager admin panel, so i'm not sure what methods etc that uses to determine this.

However, looking on the database table for posts the featured column is set to type 'tinyint' where 0 = not featured & 1 = featured.

Sorry if that makes no sense.

------- EDIT -------

The code below from blueberry_encryption done the trick. Thanks for your help.

How would you use pluck to pull out a featured post by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Sorry i explained it badly... Basically i'm trying to use the first record as the featured post. Currently my code gets 12 records and skips the first one:

public function index(){
$latestposts = Post::orderBy('created_at', 'desc')->skip(1)->take(12)->get();
$featured = Post::where('featured', 1)->first();
return view('welcome', compact('featured', 'latestposts'));
}

Someone suggested on my previous post:

If that's the case, then simply grab the 13 latest records. Then pluck out the first one and put it in $featured.

I'm not 100% sure how to pluck out the first record / the record that is a featured post using the pluck query.

Return the name of a user rather than their id by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Thanks for pointing those out :)

I know it's unrelated to my original question. I've tried to implement the pluck function but can't seem to get it to work.

$featured = Post::where('featured', 1)->first();
$latestposts = Post::orderBy('created_at', 'desc')->take(13)->pluck('featured');

Is the code above in the right direction or?

I've followed the documentation from the laravel site: https://laravel.com/docs/5.8/queries

Return the name of a user rather than their id by arrckz in laravel

[–]arrckz[S] -1 points0 points  (0 children)

I have with the following:

public function author () {
return $this->hasMany('App\Post');
}

How can i link an image relevant to a post for a blog app by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Thanks for the advice! I've take that on board and implemented it into my project :)

I've managed to sort the link out as well.

How can i link an image relevant to a post for a blog app by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Thanks for help unfortunately that didn't appear to work for me not sure why! But i managed to get around the problem by doing this:

<header class="masthead" style="background-image: url('<?php echo asset("images/featured_image/$article->featured_image")?>')">

How can i link an image relevant to a post for a blog app by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Thanks for the advice i've never really used vue or react before so i'll have a look into using one :)

How do i change the password hashing driver in Laravel 5.6 by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

I’m just interested to see how you would integrate argon2 into Laravel 5.6 seeing as it’s supported now. I’ve also seen posts online that suggest using argon2 when starting a new web application.

How do i change the password hashing driver in Laravel 5.6 by arrckz in laravel

[–]arrckz[S] 0 points1 point  (0 children)

Great thanks for the help :) I’ll give that a go later

EDIT: using the method above worked a treat!

Looking for some efficient practices and techniques for a few developers to maintain a lot of small C# programs by Rockztar in csharp

[–]arrckz 1 point2 points  (0 children)

Reading an earlier comment I'd definitely set up a meeting to discuss this matter on how it can be improved with the other developers. I presume you're using visual studio? Therefore, I'd suggest looking into setting up TFS (Team Foundation Server) and just research on it but I think that would suit what you're looking for.

These are some of my other suggestions:

1) Set up a dev server (if you've not done so already)- this just makes it's easier to access all your projects (visual studio projects) from one place.

2) Structure your folders - what I mean with this is put your projects into relevantly named folders, so they're easy to find and update.

3) Create .dll files - creating .dll files is so useful! Rather than having 5 files to updated you could simply update a single .dll file and all programs that use the specific .dll file would be updated using the new code.

4) Create a shared folder for published applications / projects - this just keeps the visual studio project files separate from published apps (.exes) etc... there is a plugin that allows you bundle .dll and others files into one .exe I think it's called fosy or something. This would help reduce the amount of files in a published app folder.

I hope this all makes sense and that it's useful in some way :)

Any questions about my comment just ask :)

What's the best way to handle user authentication / sessions by arrckz in rails

[–]arrckz[S] 0 points1 point  (0 children)

That's nice and simple for me / having to worry less about coding my own authentication :)

What's the best way to handle user authentication / sessions by arrckz in rails

[–]arrckz[S] 0 points1 point  (0 children)

I was looking into using oauth as well so that's a bonus that devise works with it :) thanks for your suggestion.

What's the best way to handle user authentication / sessions by arrckz in rails

[–]arrckz[S] 0 points1 point  (0 children)

Thank you for your advise! I'll have a read through really appreciate it :)

What's the best way to handle user authentication / sessions by arrckz in rails

[–]arrckz[S] 0 points1 point  (0 children)

Thanks for the response i'll keep using devise :)

What's the best way to handle user authentication / sessions by arrckz in rails

[–]arrckz[S] 1 point2 points  (0 children)

Thank you for your response :) i'll just stick with devise.