I can't upload a file in laravel, it gives me the Method Illuminate \ Validation \ Validator :: validateAvatar does not exist error. so say that everything is well done
I created a validator function which return the validates
via Chebli Mohamed
We were talking about Laravel 5 on its release, we are pleased today to welcome Laravel 5.1
I can't upload a file in laravel, it gives me the Method Illuminate \ Validation \ Validator :: validateAvatar does not exist error. so say that everything is well done
I created a validator function which return the validates
Showing right now
Current logged user information.
But I want to show current user information with other contestars information.
Here it's showing two results but I want to show all of them
Contest Model
Any help will be appreciated. Thanks.
Very strange situation in Laravel 1 to Many relationships, My User model
public function reminder(){
return $this->hasMany(Reminder::class);
}
Reminder Model
public function user(){
return $this->belongsTo(User::class);
}
When I try to get
dd(auth()->user()->reminder) -> null
$user_id = auth()->user()->id;
$user = User::findOrFail($user_id);
dd($user->reminder) -> success I got results.
Question is why I can't get relationship result using auth()->user()->reminder
???
I am bit a new to Laravel. I am trying to get a orders between a certain point in time. I have a variable $streamStartTime
that is set early on to Carbon::now()->timestamp
.
$streamStartTime = Carbon::now()->timestamp;
Later on, I call this:
$streamPaidOrders = Order::->whereBetween('orders.created_at', [$streamStartTime, Carbon::now()]);
Would those 2 parameters give me orders between them or are they in different formats?
This is what my AppServiceProvider's boot method looks like. My custom rule must do this: it must check that the input specified in 0'th parameter does exist and is not null, then must check current attribute's value is and array and is not null;
The problem is, when I try to access $validator
's getValue()
or validateRequired()
methods app gives me an exception like:
Method [getValue] does not exist.
How can I access those methods?
Validator::extendImplicit('imageArrayWith', function($attribute, $value, $parameters, $validator){
$imageArray = json_decode($value);
$requiredRow = $parameters[0];
$requiredRowVal = $validator->getValue($requiredRow);
if($validator->validateRequired($requiredWithRow)){
if(is_array($imageArray)){
if(count($imageArray) == 0){
return false;
}
}
return true;
}else{
return false;
}
});
I have newly added app.js file which I include in the footer as follow:
<script src="" defer></script>
it return 404 status code, but the file exists and the generated URI is correct, what is the problem?
it work fine locally, but on production server it return 404
I need assistance please. The scenario: I have a table called users and transactions in laravel. Created a blade for transaction table which will pull data as user id drop down list from users table. All user id of users table are show in transaction with dropdown lists. Transaction table has amount column with debit/credit options. User table has total amount column.
My controller -
DB::table('users')->where('userid', $request->userid)->increment('amount', $request->amount); and DB::table('users')->where('userid', $request->userid)->decrement('amount', $request->amount);
What I want to achieve
Currently, the dropdown list is working and save data in transaction table but amount can’t be debited or credited in total amount in user tables.
$request->userid is not getting value from dropdown list.
Please how do I achieve this? Thank you.