I’m looking to find out how to limit word in laravel blade. I’ve coded using substr, but it’s still not working properly. Can anyone help me? Answer The Str::words method limits the number of words in a string. An additional string may be passed to this method via its third argument to speci…
Tag: laravel-8
Middleware auth keep logging me out? Edit: RedirectIfAuthenticated logging me out?
Fairly new to Laravel and tried to make a Login page. Edit 2: Tried to use Guard and when I’m redirected to RedirectIfAuthenticated it seems somehow the auth()->check() or Auth::check() return false at handle function here’s my RedirectIfAuthenticated.php The Auth was able to store the user, bu…
Laravel 8: How to insert unique data from the DB
I need to insert some unique content into the DB using Laravel 8. Here is my code: As you can see the field numbers should stored unique numbers but I have some duplicated Hex values and I don’t want to store them at the DB. So how can I insert UNIQUE values into the DB. Note that I have already
Determine selected options based on many-to-many relationship
I have three tables: products, categories and category_product. In my edit form page I’m displaying the categories and subcategories values in a select box. The chosen category options are saved in the pivot table category_product. This table has product_id and category_id. Here’s my code. Product…
I have a problem with my laravel query builder
I’m using laravel as my web project, and I have an issue when I update my database. I have an error message on my postman after posting data. Here is the message. This is my function code to update a row on a database. I don’t know what’s going on with my code, i search for ‘transact_i…
Using both Laravel and non-laravel-PHP
I am trying to make Laravel work with a non-laravel script. I need Laravel to handle only routes that are set in the web.php file, and allow anything else that’s not defined to be handled by my non-…
Server-side testing forms laravel [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 don’t know if this can be done but I want to test through a cron job or but the larave…
Laravel Filemanager Base url for Images is wrong
I need help configuring the site url being generated by Laravel File manager. I am developing my application locally on http://127.0.0.1:8000/. The name of the application is security. But whenever I upload images, its giving them a url of: http://security.test/storage/photos/1/logo-small.jpeg How can I chang…
Laravel 8: How to style output at Models
I want to check if the status of users is Active or not. So in order to do this, I’ve added this piece of code to my Model User.php: public function isActive() { if(($this->status) == 1)…
Trying to get property ‘name’ of non-object laravel 8 and livewire
I am getting the error when I try to edit products in my eCommerce project. I can not find where i doing the mistake. when i am trying to edit product it give me the error. i am begginer to laravel 8. i can not find where to look for as it shows me the declared variables list. my class