I have models: ChatRoomMembers ChatRoom so I want to check if auth user is in chat room my relationships: ChatRoom: ChatRoomMembers: Answer So I created relationship in User Model: and I am getting only this user chat rooms
Tag: laravel
Laravel multiple foreach for inserting data into database [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 11 months ago. Improve this question I have a table with form input inside it. Whenever I click the submit button, it will save all of the data into the database
Should I add ‘ before integers when making an ENUM field
I want to create a Migration and this Migration has a field named is_active which takes one of 1 or 0 values. So I tried: But I wonder, if this alright or I should write it this way: So which one is true ? Answer You can read in the PHP Docs that string ‘0’,int 0,float 0.0 are considered as
Laravel Lumen Logging gives A facade root has not been set
I have set up the basic example of Laravel lumen with composer create-project –prefer-dist laravel/lumen demo. I am using Lumen version 8. My .env file looks like I have created a controller TrackerController and called it in routes/web.php. My /app/routes/web.php looks like I would like to add logging to stdout (so I can later pipe that data to Cloudwatch in
Laravel api route that grabs Auth::user() when Authorization is sent, but doesn’t hit 401 whenever you don’t
So right now I’m using Laravel’s default auth for api routes by doing this: The only thing with this is that it will throw a 401 if a non logged in user hits that page. What I’m wondering is if there’s a way to have a route that will login the user if a token is sent, but if not,
laravel – passing data from first page to third page
I have a booking system where I divided into three steps. First, user can input the parcel weight, postcode,etc and then generate a quotation for couriers rate which brings to the next step. Second, it shows an a list of rates for the couriers to choose and user have to select one courier and proceed to the next page which
Include extra validation in Laravel 8 using $errors Variable
I have a store Method for my TransactionController, at the moment it does validate that the required information is received (standard Laravel validation), nonetheless, it can’t check if the value received exists on a third table (since it’s a foreign key). Store method of TransactionController.php I want to add further validation to ensure that the information received is ready for
Composer dependency not met for large package [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I am needing to install a package into my Laravel project. I am using the latest version of Laravel (8), It comes preinstalled with; When I
Class not found laravel 8 only on production
Hello I’m new to Laravel and Eloquent, all I found about this problems it that it can by Case sensitivity problems but I can’t find any case problems. :Error message Class “AppModelsTvEpisode” not found I’m trying to get UserTvEpisode list to view it works fine in localhost (using Windows), but not on production server in throws an error that the
Update() in Laravel does not seem to be working
I’m working with Laravel 5.8 to develop my project and I have this table which shows some data from the DB: As you can see there’s a link named Edit for editing these data, so when someone clicks on that, this method runs: I have also added this form for updating the data sent to the edit.blade.php: And here is