Data dodania Pytanie
2018-01-11 22:01 Accessing distant relationship with belongstoMany »
So each user can own multiple pages, and each page can have multiple users (assigned a role), and each page can have a job. Now, I am getting the page...
(1) odpowiedzi
2018-01-11 08:01 How to constraint scope of hasMany relationship in a query in Laravel »
I am working on a laravel based project comprising of Authors, Posts and Comments as models. The relationship between the models is as follows: Autho...
(1) odpowiedzi
2018-01-09 09:01 Dynamic Relational Query in Laravel Eloquent »
I have a search form which has dynamic filters and I want to generate relational queries dynamically based on the presence of the different filter. u...
(1) odpowiedzi
2018-01-06 23:01 "create table as" using Laravel's eloquent »
I've got a dynamically created query object using Eloquent and would like to use that to create a table vs returning a collection using $query->get();...
(0) odpowiedzi
2018-01-05 14:01 Eloquent Query for getting all user failed transactions where user has no completed transactions »
I'm having difficulty building an eloquent query to provide a dashboard of transactions that are issue cases. Issues are defined as all failed transac...
(1) odpowiedzi
2018-01-04 15:01 Differences in relations »
I have three tables: users realizations realization_user User Model: public function realizations() { return $this->belongsToMany(Realizat...
(1) odpowiedzi
2018-01-03 21:01 Laravel newQuery() »
I've been looking at the newQuery eloquent model and best case uses and I can see the benefit in searching / filtering products based on a search page...
(2) odpowiedzi
2018-01-03 08:01 Laravel Eloquent multiple relations to same table »
I have the following table: Table: rental_request Columns: id int(11) AI PK user_id int(11) address text number varchar(45) kvm varchar(45) rent...
(2) odpowiedzi
2018-01-03 02:01 Database notifications don't show up after testing notify »
I have a unit test with the following: use \Illuminate\Notifications\DatabaseNotification; public function testMailSentAndLogged() { Notificatio...
(1) odpowiedzi
2018-01-02 08:01 Why does a search (wherehas) for decimal column in a relationship take so long in laravel? »
I have a list where I return products from laravel, This list has search box for each column, And for this i am using something like: $q = Produc...
(2) odpowiedzi
2017-12-31 11:12 Laravel-5.5 Call to member function products on Null error (Many to Many Relationships) »
Hi I created database seeder as "CartSeeder" but I cant start seeding, it gives me that error. I checked my codes several times, but it seems fine for...
(2) odpowiedzi
2017-12-31 09:12 How to calculate the percentage in eloquent? »
please have a look at the problem. You will find it interesting. I have a table member in which I have a column result. In this result column three v...
(2) odpowiedzi
2017-12-28 18:12 How to redirect to admin page with custom admin table »
Instead of the laravel multi auth I am using my own (primitive) method to have admin users. I just have an extra table in the database called PAdmin ...
(1) odpowiedzi
2017-12-28 14:12 Am I doing eager loading correctly? (Eloquent) »
I have a method that needs to pull in information from three related models. I have a solution that works but I'm afraid that I'm still running into t...
(2) odpowiedzi
2017-12-28 01:12 Eloquent save many to many relation without duplicates »
I'm using Laravel 5.5 and have a many to many relationship between products and tags, with a pivot table that has product_id and tag_id as the only tw...
(1) odpowiedzi
2017-12-26 01:12 How do I group on continuous ranges (mysql 5.7) »
I want to return an array of date time ranges of when a site is down. I am using MySQL 5.7. Table down_time created_at user_id down 2017-...
(2) odpowiedzi
2017-12-25 20:12 How to display records in view based on their first letter? »
In my controller I am passing to a view a bunch of categories in alphabetical order like this : public function index() { $categories = ...
(3) odpowiedzi
2017-12-25 13:12 Laravel hasManyThrough 2 tables »
i have two tables as below: users table: |id|name|email|password|created_at|updated_at messages table: |id|sender_id|receiver_id|message|created_a...
(2) odpowiedzi
2017-12-23 15:12 write orwhere for multi tables in eloquent »
I am using eloquent as ORM and I want to use where in multi-table like this: $raw_query = EntityCity::with(['province']); $raw_query = $raw_q...
(2) odpowiedzi
2017-12-23 11:12 Getting query result back as array »
I am having the following query: SELECT * FROM instruments LEFT join financials on instruments.id=financials.inst...
(3) odpowiedzi
2017-12-20 12:12 Build database query in Laravel with eloquent or DB »
I need your help to build a query in Laravel either eloquent or DB query would do too. My table name is Users To see the DB structure, open the foll...
(1) odpowiedzi
2017-12-19 17:12 Laravel Eloquent: Extract all entries that begin with a list of provided string »
The following request extract all entries from the users table where name=Albert or name=Alberto or name=Ana. $users = DB::table('users') ->wh...
(4) odpowiedzi
2017-12-18 15:12 Selecting ten top categories based on a columnt in another table with eloquent »
I have three tables: uploads, categories and a many-to-many table called category_upload. The tables look like this : **categories** id name **up...
(2) odpowiedzi
2017-12-18 13:12 laravel eager loading using with() vs load() after creating the parent model »
I am creating a Reply model and then trying to return the object with it's owner relation. Here is the code that returns an empty object: //file: Thr...
(1) odpowiedzi
2017-12-13 22:12 Laravel Foreign Keys with() issue »
Brand new to Laravel and trying to work the ORM to get data from two tables joined via a Foreign Key. I don't know what I am missing but it must be so...
(1) odpowiedzi
2017-12-09 11:12 Error : Trying to get property of non-object »
I have table Authors and table Uploads and I am simply trying to get all uploads for a certain author by author_id in the Uploads table. For that pur...
(1) odpowiedzi
2017-12-08 11:12 Laravel 5.5 BelongsToMany returns empty »
I'm trying to use a belongsToMany relation, i never had any problems with it but for some reason it returns empty. I've set up my relation in the Sto...
(1) odpowiedzi
2017-12-07 12:12 Best way to exclude results from a big db query in Laravel 5.2 »
I'm using Laravel 5.2 to build a big product inventory and I'm having trouble with the query that will show the products. Here's the example: I have ...
(1) odpowiedzi
2017-12-05 18:12 Laravel delete all belongsToMany relations in belongsToMany relation »
I have a Tournament model which contains a belongsToMany relationship with a Session model: class Tournament extends Model{ public function sess...
(2) odpowiedzi
2017-12-02 00:12 Laravel Eloquent cannot assign a value to the model's relation property »
I am unable to assign a value to a model's property App\person::find(1)->plan This command gives me something like this in artisan tinker ...
(2) odpowiedzi
2017-12-01 17:12 eloquent where id in from many to many »
users id roles id name user_roles user_id role_id I would like to query all users with specific roles. e.g. get all users that have the role 'admi...
(3) odpowiedzi
2017-11-30 14:11 How can I combine this query? »
I'm using Laravel Eloquent to hit the database twice. I merge the results of the 2 queries into one. How can I make this into a single query so it onl...
(2) odpowiedzi
2017-11-30 06:11 Laravel / Eloquent - Prevent "deleted_at" Column From Being Returned by get() Method »
I have a model that looks like: <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDelet...
(1) odpowiedzi
2017-11-27 11:11 Auth for multiple users tables »
I have a problem with Laravel auth module. I am rewriting old tool to laravel but have to keep old system DB structure. System use multiple DBs (sep...
(1) odpowiedzi
2017-11-24 11:11 Undefine property when trying to access data from another table in Laravel »
I have user table and profile table. In my profile table i put the user Avatar. so i try to get those Avatar by making this function into my User Mode...
(2) odpowiedzi