Alright I fix it by renaming the table in my database, but how can I disable the case sensibility with Eloquent?

|
Mayank_Rathod 2020-07-14 15:05:34
How manny we have to add field in single table of phpmyadmin
Mayank_Rathod 2020-07-14 15:05:44
Maximum fields
Mayank_Rathod 2020-07-14 15:06:09
Anyone knows?
web_artisan77 2020-07-14 15:10:40
I’m having issues with the lowercase and uppercase name of my tables with eloquent, but only happens in production not in local
Mayank_Rathod 2020-07-14 15:23:36
Send pic of errors
web_artisan77 2020-07-14 15:31:03
laravel_discuss-44923.jpg

web_artisan77 2020-07-14 15:34:13
alright I fix it by renaming the table in my database, but how can I disable the case sensibility with Eloquent?
noneshort 2020-07-14 16:42:55
https://twitter.com/MiridooBarada/status/1282978032106573825

BaradaTwitter
https://t.co/xB6Z9aun9V Visual tools for Web artisans, Automate the production of repetitive source code to minimize the risk of errors and allow the programmer to focus on writing higher value-added code. #laravel #ProjectGenerator #DataBaseDesignerTool #ERD #developer
vek866q 2020-07-14 17:08:13
I have created Laravel Vue.js TodoList web app to help someone learn. Fork and enjoy 😎😎😎 https://github.com/mulugu/laravel-vuejs-todolist
2020-07-14 17:11:34
learning-webs.com
2020-07-14 17:30:34
Guyz how do I change the /login name in laravel such as random.co.uk/login to a unique one so that it’s unpredictable such as random.com/uniqueloginurl
dantam84 2020-07-14 17:53:19
I want to create video project using laravel, anyone has source codes?
Rajat Agrawal 2020-07-14 18:34:40
does anyone has some good project that can be shared
2020-07-14 18:50:01
In laravel with node project where can i write simple button hide show js code?
badralwattar 2020-07-14 19:01:44
I want to include the navbar blade in every page of the website except one page.
Is there a way to exclude? Or I should include the navbar in all except the one I don’t want?
A P 2020-07-14 19:01:49
public function ViewLikeSave(Request $request)
{
$view_data = AppViewLike::where(‘video_id’,$request->video_id)->where(‘phone_id’,$request->phone_id)->where(‘type’,$request->type)->first();
if($request->type == “view”)
{
if(count($view_data) == 0)
{
$flag = true;
}else{
$flag = false;
}
}else{
if($request->value == 0){
$view_data = AppViewLike::where(‘video_id’,$request->video_id)->where(‘phone_id’,$request->phone_id)->where(‘type’,$request->type)->delete();
$flag = false;
}else{
if(count($view_data) == 0)
{
$flag = true;
}else{
$flag = false;
}
}
}

if($flag == true)
{
$save_data = array(
‘video_id’ => $request->video_id,
‘phone_id’ => $request->phone_id,
‘type’ => $request->type,
);
// dd($save_data);
AppViewLike::create($save_data);
if($request->type == “view”)
{
$video_data = AppVideo::where(‘id’,$request->video_id)->first();
$total_view = $video_data->view + 1;
AppVideo::where(‘id’,$request->video_id)->update(array(‘view’=>$total_view));
}
return Response::json([
‘status’ => true,
‘message’ => “Success”,
]);
}else{
return Response::json([
‘status’ => false,
‘message’ => “Success”,
]);
}
}

How to add ->doesntExist(); in video_id with where clause ? I want that if video_id already present then don’t insert the data. How to do this ?

badralwattar 2020-07-14 19:07:38
A P 2020-07-14 19:01:49
public function ViewLikeSave(Request $request)
{
$view_data = AppViewLike::where(‘video_id’,$request->video_id)->where(‘phone_id’,$request->phone_id)->where(‘type’,$request->type)->first();
if($request->type == “view”)
{
if(count($view_data) == 0)
{
$flag = true;
}else{
$flag = false;
}
}else{
if($request->value == 0){
$view_data = AppViewLike::where(‘video_id’,$request->video_id)->where(‘phone_id’,$request->phone_id)->where(‘type’,$request->type)->delete();
$flag = false;
}else{
if(count($view_data) == 0)
{
$flag = true;
}else{
$flag = false;
}
}
}

if($flag == true)
{
$save_data = array(
‘video_id’ => $request->video_id,
‘phone_id’ => $request->phone_id,
‘type’ => $request->type,
);
// dd($save_data);
AppViewLike::create($save_data);
if($request->type == “view”)
{
$video_data = AppVideo::where(‘id’,$request->video_id)->first();
$total_view = $video_data->view + 1;
AppVideo::where(‘id’,$request->video_id)->update(array(‘view’=>$total_view));
}
return Response::json([
‘status’ => true,
‘message’ => “Success”,
]);
}else{
return Response::json([
‘status’ => false,
‘message’ => “Success”,
]);
}
}

How to add ->doesntExist(); in video_id with where clause ? I want that if video_id already present then don’t insert the data. How to do this ?

First find the video

$vid = Video::where(“video_id”, $id)->get();

If($vid != null) {
// the add code
}

A P 2020-07-14 20:26:25
badralwattar 2020-07-14 19:07:38
First find the video

$vid = Video::where(“video_id”, $id)->get();

If($vid != null) {
// the add code
}

The video_id is inserting but i want that if it’s already present then don’t insert that data again and again

badralwattar 2020-07-14 20:27:29
Okay then that’s how to check if it’s already exists or not
A P 2020-07-14 20:41:49
badralwattar 2020-07-14 20:27:29
Okay then that’s how to check if it’s already exists or not

How to do this ?

Danieldrew 2020-07-14 22:48:37
laravel_discuss-44944.jpg
IlluminateSupportFacadesBlade::component(‘components.button’, ‘btn’);
In function boot
Why dont work?
Siberfx 2020-07-15 00:35:54
Check out Blade Directives usage dude
Siberfx 2020-07-15 00:38:26
A P 2020-07-14 20:41:49
How to do this ?

Check eloquent firstOrCreate and dont write messy code 🙂

Danieldrew 2020-07-15 00:43:16
Siberfx 2020-07-15 00:35:54
Check out Blade Directives usage dude

How?

Siberfx 2020-07-15 00:57:13
Official laravel documentation for blade directives
Siberfx 2020-07-15 00:57:24
To create your own
web_artisan77 2020-07-15 09:03:57
why my env(‘APP_KEY’) is always null ?? I have to run php artisan cache:clear every single time to fix it, I’m sick of it 🤮
vasanthamohan 2020-07-15 09:04:04
Is anyone used metronic theme with laravel integration?
vasanthamohan 2020-07-15 09:05:16
I am facing an issue while using datatables
vasanthamohan 2020-07-15 09:05:54
The url value not called by ajax
Siberfx 2020-07-15 10:47:44
chto za proyelt?
nithinpvarghese 2020-07-15 11:21:11
Hello,
Can any one help me to convert mysql query to Laravel?
Rajat Agrawal 2020-07-15 11:24:59
<a href={{route(‘user’,[’email’]=>$email)}}

this is my route

controller
public function a(Request $request){
$id=$request->input(’email’);

}

is this correct way to retrieve and i want my url like this

http:……../user/ag.rajat

is it correct help anyone

dhruv_lo 2020-07-15 13:13:07
Hello ppl how can I add auto-increment enrollment number in registration form with read only on a new registration
dhruv_lo 2020-07-15 13:13:58
Can I use two auto-increment in a single table??
2020-07-15 13:29:19
dhruv_lo 2020-07-15 13:13:58
Can I use two auto-increment in a single table??

Y two not just one …..

2020-07-15 13:30:12
2020-07-15 13:29:19
Y two not just one …..

Are you using mysql?

dhruv_lo 2020-07-15 13:31:20
Yes
dhruv_lo 2020-07-15 13:32:45
laravel_discuss-44983.jpg

dhruv_lo 2020-07-15 13:33:30
2020-07-15 13:29:19
Y two not just one …..

coz i already have 1 auto increment on id

dhruv_lo 2020-07-15 13:34:33
laravel_discuss-44985.jpg

dhruv_lo 2020-07-15 13:35:10
I want to show it here in enrollment field
dhruv_lo 2020-07-15 13:35:34
With new +1 increment on new registration
2020-07-15 13:48:09
You can write a function that generates an enrollment number that increments from the last number given …that’s how we handle our enrollments number in our laravel student management system we have developed but from the side of the database am not sure if its possible
dhruv_lo 2020-07-15 13:48:45
okey buddy
dhruv_lo 2020-07-15 13:49:11
do u have any example ?
2020-07-15 13:50:44
I can do an algorithm for you how I wrote it pm
dhruv_lo 2020-07-15 13:51:44
okey
2020-07-15 14:03:56
$Last_record = AppUsers::all()-order by(‘id’)->latest()->first();
Will get the last record inserted
Check for enrollements-number
If($Last_record->enrollment_no)
$newEnrollmentNo= $Last_record->enrollment_no +1
Else
$newEnrollmentNo= Carbon::Now()->y.100
2020-07-15 14:04:10
Something like that
|