Do you have a table for courses which the user already enrolled for?

|
Blueman45 2021-06-27 17:47:43
Yes. You can make different functions for different operations in same controller… You will make route accordingly
Blueman45 2021-06-27 17:48:58
@prodevguy route will be targeted to controller name@function name
DesolatorMagno 2021-06-27 20:15:42
etekumoses 2021-06-27 17:46:31
Hey guys I would like to be guided well am a starter in laravel but for the past one month I have been trying and able to write code in laravel performing the crud operations and also using templates
My question is how do I master how to write apis and also can I use the same controller for both api and the crud or I have to create separate

You should have a controller for API and another for web.

DesolatorMagno 2021-06-27 20:16:45
Always try to use the standar name for functions, and remember not to be afraid of making more controllers.
ProAbdulrahman 2021-06-27 21:01:57
I’m working on a courses website
in page “all courses”
when user login
the courses user hasn’t enroll show the button “Enroll course”
and the courses had user enroll show the button “continue study”
In blade I write foreach and show all courses
How I can do this logic?
should I use if condition or what?
I did the pivot table correctly, user_id, course_id
likemind021 2021-06-28 00:56:09
ProAbdulrahman 2021-06-27 21:01:57
I’m working on a courses website
in page “all courses”
when user login
the courses user hasn’t enroll show the button “Enroll course”
and the courses had user enroll show the button “continue study”
In blade I write foreach and show all courses
How I can do this logic?
should I use if condition or what?
I did the pivot table correctly, user_id, course_id

Do you have a table for courses which the user already enrolled for?

ProAbdulrahman 2021-06-28 00:57:38
No
ProAbdulrahman 2021-06-28 00:57:56
Should I ?
likemind021 2021-06-28 00:59:09
You should have a table of enrolled couses

It will have the userId and the course Id

So when you want to check if the user already enrolled, just check the data from the table. If it returns a value then then user has enrolled and if not, the user has not

ProAbdulrahman 2021-06-28 01:01:23
likemind021 2021-06-28 00:59:09
You should have a table of enrolled couses

It will have the userId and the course Id

So when you want to check if the user already enrolled, just check the data from the table. If it returns a value then then user has enrolled and if not, the user has not

What’s different between Pivot table and this?

ProAbdulrahman 2021-06-28 01:01:35
Or it is same
ProAbdulrahman 2021-06-28 01:02:11
I have user_id, course_id
www_ncis_ir 2021-06-28 05:54:19
ProAbdulrahman 2021-06-28 01:01:35
Or it is same

Aniket Bhosale 2021-06-28 07:31:10
Pratik 2021-06-27 17:25:58
Any marathi developer here?

Yes

Jaseel 2021-06-28 08:28:07
ProAbdulrahman 2021-06-27 21:01:57
I’m working on a courses website
in page “all courses”
when user login
the courses user hasn’t enroll show the button “Enroll course”
and the courses had user enroll show the button “continue study”
In blade I write foreach and show all courses
How I can do this logic?
should I use if condition or what?
I did the pivot table correctly, user_id, course_id

Pivot table is enough. Use if condition

ProAbdulrahman 2021-06-28 08:28:53
Jaseel 2021-06-28 08:28:07
Pivot table is enough. Use if condition

laravel_discuss-86690.jpg
Like this ?

Jaseel 2021-06-28 08:50:27
ProAbdulrahman 2021-06-28 08:28:53
Like this ?

Show your controller function

WebDev 2021-06-28 09:08:55
https://stacksjar.com/post/use-of-font-ligatures-in-vs-code

Use of Font Ligatures in VS Code | StacksjarStacksjar
In this article you will learn how to set font ligatures in Visual Studio Code. Steps to set your vscode font ligatures and make fonts look elegant. A ligature is a special character that combines two (or sometimes three) characters into a single character. Install coding font ligatures in vs code.
ProAbdulrahman 2021-06-28 12:10:13
Jaseel 2021-06-28 08:50:27
Show your controller function

laravel_discuss-86693.jpg

2021-06-28 12:50:15
can anyone suggest how to work on referal system , i have bunch of courses and i hired 10 people for promotion if any sell come from link shared by hired person will rewarded some points
2021-06-28 12:51:08
hired person act as subamin
Jaseel 2021-06-28 13:06:40
ProAbdulrahman 2021-06-28 08:28:53
Like this ?

Instead of looping. Try this.
if($course->users->where(‘id’, Auth::id())->count()) {
I have this course
} else {
Purchase
}

ProAbdulrahman 2021-06-28 13:15:44
Jaseel 2021-06-28 13:06:40
Instead of looping. Try this.
if($course->users->where(‘id’, Auth::id())->count()) {
I have this course
} else {
Purchase
}

Nice, its works, thanks!

Lalit Rana 2021-06-28 13:36:51
2021-06-28 12:50:15
can anyone suggest how to work on referal system , i have bunch of courses and i hired 10 people for promotion if any sell come from link shared by hired person will rewarded some points

Create a unique link of each user s, When anyome register . Then you can easily get the Data

thekiharani 2021-06-28 14:48:01
How do one decide whether to do a conventional controller-blade app or do Laravel API then build a separate front-end (maybe vue or react) ?
Djuraev_Oybek 2021-06-28 15:15:17
How can I insert with a scanner stroke into a certain input? Thank you in advance
Rahul Kothari 2021-06-28 15:20:30
laravel_discuss-86707.jpg

Rahul Kothari 2021-06-28 15:20:50
When I install laravel in my system it give this error
Rahul Kothari 2021-06-28 15:21:09
Can anyone tell me how I solve this pls
Lalit Rana 2021-06-28 15:35:15
Rahul Kothari 2021-06-28 15:20:50
When I install laravel in my system it give this error

You are doing wrong

Lalit Rana 2021-06-28 15:35:42
Lalit Rana 2021-06-28 15:35:15
You are doing wrong

I can’t see laravel install command

SauravK8876 2021-06-28 15:47:44
Can anyone help me i making er and dfd..of a project?
ateframadan22 2021-06-28 16:17:52
Yo, I have orders tables that have status column on it, I wanna list the orders by status depending on user permissions
ateframadan22 2021-06-28 16:18:48
example, statuses can be accepted, pending, shipped. and there’s that user that can only see accepted
ateframadan22 2021-06-28 16:19:00
and/or shipped
|