Who help me to deploy my laravel website?

|
2019-04-20 18:29:17
my create profile table:
public function up()
{
Schema::create(‘profiles’, function (Blueprint $table) {
$table->increments(‘id’);
$table->integer(‘user_id’)->unsigned();
$table->foreign(‘user_id’)->references(‘id’)->on(‘users’)->onDelete(‘cascade’);
$table->string(‘first_name’);
$table->string(‘last_name’);
$table->string(‘phone’);
$table->string(‘institution’);
$table->string(‘department’)->nullable();
$table->string(‘city’);
$table->string(‘country’);
$table->string(‘zip’);
$table->rememberToken();
$table->timestamps();
});
}
tonyfrenzy 2019-04-21 01:09:53
2019-04-20 18:25:17
I want to make make relation userstable and profilestable with One to One Relation
I already set relation beetwen those table on User model and Profile model:
here is User.php
public function profile(){
return $this->hasOne(‘AppProfile’);
}

and here is my Profile.php
public function user() {
return $this->belongsTo(‘AppUser’);
}

As so far, those table already have relation, but the problem is the user can create more than One profile.
I have read some related tutorial with add some code to the ProfileController on store class but didn’t solve my problem. Here is my store function:
public function store(Request $request)
{
$profile=new Profile();
$profile->user_id = auth()->user()->id;
$profile->first_name=$request->get(‘first_name’);
$profile->last_name=$request->get(‘last_name’);
$profile->phone=$request->get(‘phone’);
$profile->institution=$request->get(‘institution’);
$profile->department=$request->get(‘department’);
$profile->city=$request->get(‘city’);
$profile->country=$request->get(‘country’);
$profile->zip=$request->get(‘zip’);
$profile->save();
return view(‘profile.ku’)->with(‘success’, ‘Abstract has been successfully submited pending for approval’);
}
Wish any body can help, please

Having a One to One Relationship does not stop users from creating more than one profile, you can restrict multiple account creation by adding a unique key constraint to a column to your profiles table.

Eg.
Make user_id an unique filed in the profiles table and you will not be able to create more than one record for a user because of the database’s unique key constraints.

tonyfrenzy 2019-04-21 01:10:52
2019-04-20 18:29:17
my create profile table:
public function up()
{
Schema::create(‘profiles’, function (Blueprint $table) {
$table->increments(‘id’);
$table->integer(‘user_id’)->unsigned();
$table->foreign(‘user_id’)->references(‘id’)->on(‘users’)->onDelete(‘cascade’);
$table->string(‘first_name’);
$table->string(‘last_name’);
$table->string(‘phone’);
$table->string(‘institution’);
$table->string(‘department’)->nullable();
$table->string(‘city’);
$table->string(‘country’);
$table->string(‘zip’);
$table->rememberToken();
$table->timestamps();
});
}

.
.
$table->integer(‘user_id’)->unsigned()->unique();
.
.

2019-04-21 01:47:33
How better make database sorting with pagination without JS with blade
2019-04-21 06:58:47
tonyfrenzy 2019-04-21 01:09:53
Having a One to One Relationship does not stop users from creating more than one profile, you can restrict multiple account creation by adding a unique key constraint to a column to your profiles table.

Eg.
Make user_id an unique filed in the profiles table and you will not be able to create more than one record for a user because of the database’s unique key constraints.

This only affect to profiles table right??? What if I have another table with one to one relation with the userstable and i need this table to allow user to create more than one record. Is that possible?

rachitbucha 2019-04-21 07:59:49
@include not working in views
rachitbucha 2019-04-21 07:59:57
Please help
berto309 2019-04-21 10:41:01
Name file with extension .blade.php
rachitbucha 2019-04-21 10:42:00
berto309 2019-04-21 10:41:01
Name file with extension .blade.php

Thanks Brother

rachitbucha 2019-04-21 12:22:01
laravel_discuss-4992.jpg

rachitbucha 2019-04-21 12:22:04
PLZ HELP
rachitbucha 2019-04-21 12:22:04
laravel_discuss-4993.jpg

rachitbucha 2019-04-21 12:37:14
I found the error thanks
2019-04-21 14:00:10
Looks like U missed the underscore (_) in your javascript file in partials folder, should be _javascript.blade.php
perudragon 2019-04-21 14:25:20
Hi guys….. Perhaps you know how to stop email spoofing? 😅
tonyfrenzy 2019-04-21 16:09:10
2019-04-21 06:58:47
This only affect to profiles table right??? What if I have another table with one to one relation with the userstable and i need this table to allow user to create more than one record. Is that possible?

Yes, on profiles table.

Then user One-to-Many becuase that relationship is not One-to-One.

2019-04-21 16:12:14
tonyfrenzy 2019-04-21 16:09:10
Yes, on profiles table.

Then user One-to-Many becuase that relationship is not One-to-One.

Ofcourse I meant one to many for the other table 😅. Thanks alot

tonyfrenzy 2019-04-21 16:26:09
2019-04-21 16:12:14
Ofcourse I meant one to many for the other table 😅. Thanks alot

You mean profiles table?

Here is what you need to do:
One-to-One on users table
One-to-One on profiles table
(but on profiles table, user_id must be ->unique())

tonyfrenzy 2019-04-21 16:28:14
tonyfrenzy 2019-04-21 16:26:09
You mean profiles table?

Here is what you need to do:
One-to-One on users table
One-to-One on profiles table
(but on profiles table, user_id must be ->unique())

Since you want only one record for a user.

Once you want more than one record for a particular model by a user the One-to-Many or other type of relationship will be more appropriate.

2019-04-21 17:44:11
Ok, now it’s work fine. Thanks
senhorY 2019-04-21 20:02:22
+1
vfd14889 2019-04-21 22:23:58
https://laraveldaily.com/advanced-laravel-20-topics-and-links-to-learn-them/

Advanced Laravel: 14 Topics and Links to Learn Them – Laravel DailyLaravel Daily
Quite often I get a question from junior developers like “how to get better at Laravel”, and there’s so much to study potentially that I decided to gather the topics and classify them somehow. Let’s begin. Notice: this is kind of a follow-up on my article How to Test Junior Laravel Developer Skills. Topic 1. […]
2019-04-22 13:32:24
Mehrnoosh Abdollahi 2019-04-17 10:58:26
Hi
How can I solve this error?

Try to reinstall your laravel

tonyfrenzy 2019-04-22 13:37:18
2019-04-17 10:41:08
I am looking for a backend developer part time – someone interested?

Are you still looking for one?
If yes, let’s DM

2019-04-22 20:02:09
+1
2019-04-23 07:40:54
Why we need refresh token with generated token? Can anybody explain please..
2019-04-23 07:43:32
I meant Why we need refresh token with accesss token…
tonyfrenzy 2019-04-23 09:24:19
2019-04-23 07:40:54
Why we need refresh token with generated token? Can anybody explain please..

They serve different roles at authenticating an api request.
More like two layers of security but I assume you understand basic concept of APIs.

This should help:
https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/
… TLDR; …

ACCESS Token:
– 1. Guards client requests (determines authenticity/authorization of a client request).
– 2. Works at RESOURCE server section.
– 3. Short-lived.
– 4. Not as jealously gaurded as refresh token.
– 5. Access a resource directly.

REFRESH Token:
– 1. Guards the Access Tokens (determines authenticity of the current Access Token).
– 2. Generates a new Access Token (when old one expires and gets access to a new resource for the first) time by creating a new access token 👌)
– 3. Works at AUTH server section.
– 4. Life span is longer.
– 5. Jealously guarded by storing in more secure location to prevent leakage.

You don’t have to worry about these things though, they have been handled in Laravel.
Guess you only want to know their differences.

What Are Refresh Tokens and How to Use Them SecurelyAuth0 – Blog
Learn about refresh tokens and how they help developers balance security and usability in their applications.
2019-04-23 11:27:23
tonyfrenzy 2019-04-23 09:24:19
They serve different roles at authenticating an api request.
More like two layers of security but I assume you understand basic concept of APIs.

This should help:
https://auth0.com/blog/refresh-tokens-what-are-they-and-when-to-use-them/
… TLDR; …

ACCESS Token:
– 1. Guards client requests (determines authenticity/authorization of a client request).
– 2. Works at RESOURCE server section.
– 3. Short-lived.
– 4. Not as jealously gaurded as refresh token.
– 5. Access a resource directly.

REFRESH Token:
– 1. Guards the Access Tokens (determines authenticity of the current Access Token).
– 2. Generates a new Access Token (when old one expires and gets access to a new resource for the first) time by creating a new access token 👌)
– 3. Works at AUTH server section.
– 4. Life span is longer.
– 5. Jealously guarded by storing in more secure location to prevent leakage.

You don’t have to worry about these things though, they have been handled in Laravel.
Guess you only want to know their differences.

Sir,which is secure location to store refresh tokens?

2019-04-23 12:02:47
Guys i am need from eloquent array without key, how i could get it?
2019-04-23 12:06:58
Hello need some help
2019-04-23 12:07:04
Am new with laravel
2019-04-23 12:07:49
Need to get user records according to their states
2019-04-23 12:07:52
some please i am need this. This something with ->values()->toArray()
2019-04-23 12:08:52
Need to have a select option with the States as options so the records would be fetched according to the states selected
rafael_santos90 2019-04-23 12:57:15
Hey guys.
Is hard to migrate a domain?
I have a .xyz and bought a .com, now I need to migrate. xD
2019-04-23 13:30:27
Not hard
لشگر ورماخت 2019-04-23 17:13:17
rafael_santos90 2019-04-23 12:57:15
Hey guys.
Is hard to migrate a domain?
I have a .xyz and bought a .com, now I need to migrate. xD

Hi…
it’s not hard..
Just upload the current domain information to the new domain …

Saulo_Soares 2019-04-23 18:49:50
Hi folks! i’m deciding if i use repository in a big project (mainly using this pack https://github.com/andersao/l5-repository), What you guys think? How do i strutucture the project to coding less? Do you have some course or some step by step?

GitHub – andersao/l5-repository: Laravel 5 – Repositories to abstract the database layerGitHub
Laravel 5 – Repositories to abstract the database layer – GitHub – andersao/l5-repository: Laravel 5 – Repositories to abstract the database layer
rafael_santos90 2019-04-23 19:01:40
لشگر ورماخت 2019-04-23 17:13:17
Hi…
it’s not hard..
Just upload the current domain information to the new domain …

Thanks! 😀

tonyfrenzy 2019-04-23 19:22:57
2019-04-23 11:27:23
Sir,which is secure location to store refresh tokens?

Generally as encrypted cookies or so but not at publicly accessible part of your server.

If you’re using a framework like laravel you don’t have to worry much but advisable to check the documentation to know what goes on under the hood.

Developers/companies/frameworks implement it differently so you’ve got to check what works best for you.

eAmirGH 2019-04-23 19:44:39
laravel_discuss-5053.jpg
Hello guys im returning some nested json resopnse from laravel controller from a route in api
problem is after 4th and 5th child of the json its not showning the json data
eAmirGH 2019-04-23 19:45:28
eAmirGH 2019-04-23 19:44:39
Hello guys im returning some nested json resopnse from laravel controller from a route in api
problem is after 4th and 5th child of the json its not showning the json data

here is my controller:
$results = [];
$cases = [];
$mobile = Mobile::getBySlug($mobile);
$material = Material::getBySlug($collection);
$collection = Collection::getBySlug($collection);
$stickers = $collection->stickers;
$modes = $material->modes;
foreach ($modes as $mode)
{
array_push($cases, Acase::getByModeAndMobile($mode->id, $mobile->id));
}
$cases = collect($cases);
foreach ($stickers as $sticker)
{
array_push($results, [
‘sticker’ => $sticker->name,
‘sticker_slug’ => $sticker->slug,
‘modes’ => ModeResource::collection($modes),
‘cases’ => $cases->each(function (
$case
) use ($sticker)
{
return [
‘name’ => $case->name,
‘slug’ => $case->slug,
‘mobile’ => $case->mobile->name,
‘mobile_slug’ => $case->mobile->slug,
‘brand’ => $case->mobile->brand->name,
‘brand_slug’ => $case->mobile->brand->slug,
‘mode’ => $case->mode->name,
‘mode_slug’ => $case->mode->slug,
‘price’ => (float) $case->price,
‘sss’ => GalleryResource::collection(Gallery::where(‘acase_id’,
$case->id)->where(‘sticker_id’, $sticker->id)->get()),
];
}),

]);
}

return response()->json($results);

eAmirGH 2019-04-23 19:47:13
ive checked data with dd() function there is no data returning blank or null at all
senhorY 2019-04-23 20:40:15
Hey, anyone know how to paginate two collections at the same time?
senhorY 2019-04-23 20:41:20
I mean, if I am in page 2 of collection one, keep it there if I click on page 2 of the second collection
eAmirGH 2019-04-23 21:40:54
eAmirGH 2019-04-23 19:45:28
here is my controller:
$results = [];
$cases = [];
$mobile = Mobile::getBySlug($mobile);
$material = Material::getBySlug($collection);
$collection = Collection::getBySlug($collection);
$stickers = $collection->stickers;
$modes = $material->modes;
foreach ($modes as $mode)
{
array_push($cases, Acase::getByModeAndMobile($mode->id, $mobile->id));
}
$cases = collect($cases);
foreach ($stickers as $sticker)
{
array_push($results, [
‘sticker’ => $sticker->name,
‘sticker_slug’ => $sticker->slug,
‘modes’ => ModeResource::collection($modes),
‘cases’ => $cases->each(function (
$case
) use ($sticker)
{
return [
‘name’ => $case->name,
‘slug’ => $case->slug,
‘mobile’ => $case->mobile->name,
‘mobile_slug’ => $case->mobile->slug,
‘brand’ => $case->mobile->brand->name,
‘brand_slug’ => $case->mobile->brand->slug,
‘mode’ => $case->mode->name,
‘mode_slug’ => $case->mode->slug,
‘price’ => (float) $case->price,
‘sss’ => GalleryResource::collection(Gallery::where(‘acase_id’,
$case->id)->where(‘sticker_id’, $sticker->id)->get()),
];
}),

]);
}

return response()->json($results);

anyone can help me with this?

alexanderdavii 2019-04-23 22:09:36
laravel_discuss-5059.jpg
who help me to deploy my laravel website ? i cant understan why still whowing this error
diangelisj 2019-04-24 04:26:55
alexanderdavii 2019-04-23 22:09:36
who help me to deploy my laravel website ? i cant understan why still whowing this error

Dude! Do you solve the problem?

DivByZero 2019-04-24 04:46:47
alexanderdavii 2019-04-23 22:09:36
who help me to deploy my laravel website ? i cant understan why still whowing this error

what is your webserver ?

|