How can i generate unique number in store it with other data come from a form?

|
DesolatorMagno 2020-06-15 23:23:26
You use the model to insert the data, in the seeder, or any file and them you use it in the seeder, you put the data and insert into database if it is not already there, it is a option.

You could aso implement something like Migration, where you store what seeder you already did.

duruiz 2020-06-15 23:37:56
DesolatorMagno 2020-06-15 23:23:26
You use the model to insert the data, in the seeder, or any file and them you use it in the seeder, you put the data and insert into database if it is not already there, it is a option.

You could aso implement something like Migration, where you store what seeder you already did.

yeah! have a way to control it and only run the new ones would be ideal.

amirAutomationEnginner 2020-06-16 00:14:59
Hi guys i learned laravel and bootstrap4 what more things should i learn to be a fullstack web developer
amirAutomationEnginner 2020-06-16 00:15:31
Can i show me a road map thanks
DesolatorMagno 2020-06-16 00:27:56
DesolatorMagno 2020-06-14 23:14:01
https://github.com/kamranahmedse/developer-roadmap
Many call me crazy when i share these link XD

here

DesolatorMagno 2020-06-16 00:28:23
And yes, that is a lot.
DesolatorMagno 2020-06-16 00:38:17
https://github.com/kamranahmedse/developer-roadmap/tree/master/translations
BTW, there is a section for languages.

kamranahmedse/developer-roadmapGitHub
Roadmap to becoming a web developer in 2020. Contribute to kamranahmedse/developer-roadmap development by creating an account on GitHub.
VICTOR DADA THE BRAND 2020-06-16 05:08:55
Okkk
VICTOR DADA THE BRAND 2020-06-16 05:09:11
Join Join Join

Join Join bro

https://criclines2.blogspot.com/2020/06/today-match-prediction-pakistanska.html?m=1

Today match prediction-Pakistanska Foreningen vs StocKholm CC-ECS T10 2020 7th Match-Who Will WinBlogspot
June 16, 2020 Cricket Match Prediction 100 Sure, Safe, Accurate, and Today Cricket Match Prediction, Today Match Prediction – Who Will W…
VICTOR DADA THE BRAND 2020-06-16 05:11:39
Join Join bro

https://criclines2.blogspot.com/2020/06/today-match-prediction-pakistanska.html?m=1

Today match prediction-Pakistanska Foreningen vs StocKholm CC-ECS T10 2020 7th Match-Who Will WinBlogspot
June 16, 2020 Cricket Match Prediction 100 Sure, Safe, Accurate, and Today Cricket Match Prediction, Today Match Prediction – Who Will W…
Yousuf_Mahmud_Fahim 2020-06-16 05:47:40
2020-06-15 17:40:03
guys , how can i solve this problem ?

Check you internet connections.

YOUCODEWORLD 2020-06-16 07:37:10
Hi all
Why the upload m4a file can’t validate?
$validate = $this->validate($request, [
‘audio’ => ‘ nullable | file | mimetypes:audio/mp4,audio/x-m4a|mimes:m4a’
]);
Dos’t work.
YOUCODEWORLD 2020-06-16 07:40:35
laravel_discuss-41669.jpg

oxbir 2020-06-16 08:56:53
I have multiple tables. I want to update data on tables from a single form. I am able to update the users table but data on socials are not updated. My edit form has dynamic fields for texts and images where user can add as many fields.
oxbir 2020-06-16 08:57:18
I have two tables users and socials.
oxbir 2020-06-16 08:57:31
socials table
oxbir 2020-06-16 08:58:01
public function up()
{
Schema::create(‘socials’, function (Blueprint $table) {
$table->bigIncrements(‘id’);
$table->string(‘name’);
$table->timestamps();
});
}
oxbir 2020-06-16 08:58:23
web.php
oxbir 2020-06-16 08:58:49
Route::put(‘users/{user}/edit’, ‘HomeController@update’)->name(‘user.update’);
oxbir 2020-06-16 08:59:07
index.blade.php
oxbir 2020-06-16 08:59:34
“`
<form action=”{{ route(‘user.update’, auth()->id()) }}” method=”POST” enctype=”multipart/form-data”>
@csrf
@method(‘PUT’)
<div class=”row”>
<div class=”col-md-2″>
<input name=”image” onchange=”previewFile()” type=”file” class=”d-none”>
@if (auth()->user()->image)
<img src=”{{ asset(‘images/users/’.auth()->user()->image) }}” class=”img-fluid rounded-circle cursor-pointer”>
@else
<img src=”{{ asset(‘images/avatar.png’) }}” class=”img-fluid cursor-pointer”>
@endif
</div>
<div class=”col-md-10″>
<div class=”row”>
<div class=”col-md-4″>
<div class=”form-group”>
<label for=”first_name”>first_name</label>
<input type=”text” class=”form-control” value=”{{ auth()->user()->first_name }}” id=”first_name” name=”first_name”>
</div>
</div>
<div class=”col-md-4″>
<div class=”form-group”>
<label for=”last_name”>last_name</label>
<input type=”text” class=”form-control” value=”{{ auth()->user()->last_name }}” id=”last_name” name=”last_name”>
</div>
</div>

<div class=”col-md-4″>
<div class=”form-group”>
<label for=”job_title”>job_title</label>
<input type=”text” class=”form-control” id=”job_title” value=”{{ auth()->user()->job_title }}” name=”job_title”>
</div>
</div>
</div>
<div class=”col-md-2″>
<div class=”form-group”>
<label for=”gender”>gender</label>
<select id=”gender” name=”gender” class=”form-control”>
<option value=”1″ {{ auth()->user()->gender == 1 ? ‘selected’ : ” }}>male</option>
<option value=”0″ {{ auth()->user()->gender == 0 ? ‘selected’ : ” }}>female</option>
</select>
</div>
</div>
</div>
<div class=”row” id=”dynamicSocial”>

</div>
</div>
<input type=”submit” class=”btn btn-success btn-block” value=”save”>
</form>

<script>
var countSocial = 1;
dynamicSocial(countSocial);

function dynamicSocial (number) {
var html = ” +
‘<div class=”col-md-6 position-relative”>n’ +
‘<i class=”fas fa-times position-absolute” id=”delSocial”></i>’ +
‘<div class=”row”>n’ +
‘<div class=”col-md-4″>n’ +
‘<div class=”form-group”>n’ +
‘<label for=”social_id”>social_id</label>n’ +
‘<select id=”social_id” name=”social_id[]” class=”form-control”>n’ +
‘@foreach($socials as $social)n’ +
‘<option {{ auth()->user()->social->id == $social->id ? ‘selected’ : ” }} value=”{{ $social->id }}”>n’ +
‘{{ $social->name }}n’ +
‘</option>n’ +
‘@endforeachn’ +
‘</select>n’ +
‘</div>n’ +
‘</div>n’ +
‘<div class=”col-md-8″>n’ +
‘<div class=”form-group”>n’ +
‘<label for=”related_id”>related_id</label>n’ +
‘<input value=”{{ auth()->user()->related_id }}” id=”related_id” name=”related_id[]” class=”form-control”>n’ +
‘</div>n’ +
‘</div>n’ +
‘</div>n’ +
‘</div>’;
$(‘#dynamicSocial’).append(html);
}

$(‘#addSocial’).on(‘click’,function () {
countSocial++;
dynamicSocial(countSocial);
});

$(document).on(‘click’, ‘#delSocial’, function() {
$(this).parent().remove();
});

$(document).on(‘click’, ‘.sw-btn-next’, function(event) {
event.preventDefault();
$(‘#formInformation’).submit();
});
</script> <form action=”{{ route(‘user.update’, auth()->id()) }}” method=”POST” enctype=”multipart/form-data”>
@csrf
@method(‘PUT’)
<div class=”row”>
<div class=”col-md-2″>
<input name=”image” onchange=”previewFile()” type=”fi

oxbir 2020-06-16 09:00:24
What?
oxbir 2020-06-16 09:01:17
<form action=”{{ route(‘user.update’, auth()->id()) }}” method=”POST” enctype=”multipart/form-data”>
@csrf
@method(‘PUT’)
<div class=”row”>
<div class=”col-md-2″>
<input name=”image” onchange=”previewFile()” type=”file” class=”d-none”>
@if (auth()->user()->image)
<img src=”{{ asset(‘images/users/’.auth()->user()->image) }}” class=”img-fluid rounded-circle cursor-pointer”>
@else
<img src=”{{ asset(‘images/avatar.png’) }}” class=”img-fluid cursor-pointer”>
@endif
</div>
<div class=”col-md-10″>
<div class=”row”>
<div class=”col-md-4″>
<div class=”form-group”>
<label for=”first_name”>first_name</label>
<input type=”text” class=”form-control” value=”{{ auth()->user()->first_name }}” id=”first_name” name=”first_name”>
</div>
</div>
<div class=”col-md-4″>
<div class=”form-group”>
<label for=”last_name”>last_name</label>
<input type=”text” class=”form-control” value=”{{ auth()->user()->last_name }}” id=”last_name” name=”last_name”>
</div>
</div>

<div class=”col-md-4″>
<div class=”form-group”>
<label for=”job_title”>job_title</label>
<input type=”text” class=”form-control” id=”job_title” value=”{{ auth()->user()->job_title }}” name=”job_title”>
</div>
</div>
</div>
<div class=”col-md-2″>
<div class=”form-group”>
<label for=”gender”>gender</label>
<select id=”gender” name=”gender” class=”form-control”>
<option value=”1″ {{ auth()->user()->gender == 1 ? ‘selected’ : ” }}>male</option>
<option value=”0″ {{ auth()->user()->gender == 0 ? ‘selected’ : ” }}>female</option>
</select>
</div>
</div>
</div>
<div class=”row” id=”dynamicSocial”>

</div>
</div>
<input type=”submit” class=”btn btn-success btn-block” value=”save”>
</form>

oxbir 2020-06-16 09:02:57
<script>
var countSocial = 1;
dynamicSocial(countSocial);

function dynamicSocial (number) {
var html = ” +
‘<div class=”col-md-6 position-relative”>n’ +
‘<i class=”fas fa-times position-absolute” id=”delSocial”></i>’ +
‘<div class=”row”>n’ +
‘<div class=”col-md-4″>n’ +
‘<div class=”form-group”>n’ +
‘<label for=”social_id”>social_id</label>n’ +
‘<select id=”social_id” name=”social_id[]” class=”form-control”>n’ +
‘@foreach($socials as $social)n’ +
‘<option {{ auth()->user()->social->id == $social->id ? ‘selected’ : ” }} value=”{{ $social->id }}”>n’ +
‘{{ $social->name }}n’ +
‘</option>n’ +
‘@endforeachn’ +
‘</select>n’ +
‘</div>n’ +
‘</div>n’ +
‘<div class=”col-md-8″>n’ +
‘<div class=”form-group”>n’ +
‘<label for=”related_id”>related_id</label>n’ +
‘<input value=”{{ auth()->user()->related_id }}” id=”related_id” name=”related_id[]” class=”form-control”>n’ +
‘</div>n’ +
‘</div>n’ +
‘</div>n’ +
‘</div>’;
$(‘#dynamicSocial’).append(html);
}

$(‘#addSocial’).on(‘click’,function () {
countSocial++;
dynamicSocial(countSocial);
});

$(document).on(‘click’, ‘#delSocial’, function() {
$(this).parent().remove();
});

$(document).on(‘click’, ‘.sw-btn-next’, function(event) {
event.preventDefault();
$(‘#formInformation’).submit();
});
</script>

oxbir 2020-06-16 09:03:20
HomeController.php
oxbir 2020-06-16 09:03:33
“`
oxbir 2020-06-16 09:03:44
public function update(Request $request, User $user)
{
$user->first_name = $request->first_name;
$user->last_name = $request->last_name;
$user->job_title = $request->job_title;
$user->gender = $request->gender;
$user->social_id = $request->social_id;
$user->related_id = $request->related_id;
$user->save();
return redirect()->route(‘index’);
}
oxbir 2020-06-16 09:04:02
I get this error.
oxbir 2020-06-16 09:04:19
Array to string conversion
oxbir 2020-06-16 09:04:38
And I update my controller
oxbir 2020-06-16 09:05:00
foreach($request->social_id as $socialId){
$socialId .= $socialId.”,”;
}
foreach($request->related_id as $relatedId){
$relatedId .= $relatedId.”,”;
}
$user->social_id = $socialId;
$user->related_id = $relatedId;
oxbir 2020-06-16 09:05:16
I get this error
oxbir 2020-06-16 09:05:30
Trying to get property of non-object
oxbir 2020-06-16 09:05:53
I think for save an array , it need to protected $casts; Is that your opinion? Now I don’t know what you think.
’| 2020-06-16 12:26:08
laravel_discuss-41700.jpg

’| 2020-06-16 12:26:19
I have these problem
’| 2020-06-16 12:27:02
How can i solve it
YOUCODEWORLD 2020-06-16 12:35:41
’| 2020-06-16 12:27:02
How can i solve it

You environment no have PHP

’| 2020-06-16 12:36:36
I didnt understand
’| 2020-06-16 12:36:47
I work in laravel
YOUCODEWORLD 2020-06-16 12:37:21
you open terminal try type php -v
YOUCODEWORLD 2020-06-16 12:37:59
You try set environment
YOUCODEWORLD 2020-06-16 12:38:33
If you didn’t I remote help you.
YOUCODEWORLD 2020-06-16 12:46:22
No need project folders
YOUCODEWORLD 2020-06-16 12:46:34
She php doesn’t work
Roham0010 2020-06-16 12:53:17
YOUCODEWORLD 2020-06-16 12:46:22
No need project folders

Yes you are right 👍

Acird Burn 2020-06-16 13:18:27
anyone here whose very good with Linux and deploying nodejs
skys215 2020-06-16 13:22:58
It’s laravel group
Z_Yamin 2020-06-16 13:24:50
how can i generate unique number in store it with other data come from a form ?
Jack_rub 2020-06-16 13:31:50
hi
can you please help me i am facing error when I pull my code from bitbucket
|