tinker Questions

4

How can I break to a new line using laravel tinker? So instead of: $users = User::all(); foreach($users as $user) {echo $user->email;} I want to be able to write it as follows: $users = User:...
Sea asked 1/5, 2020 at 12:14

3

Solved

How can I write a command on two lines with Laravel Artisan Tinker ? User::whereEmail('[email protected]') ->get() PHP Parse error: Syntax error, unexpected T_OBJECT_OPERATOR on line 1
Hedden asked 30/3, 2022 at 5:25

5

Solved

I am unable Model Factory in Laravel Tinker. //ItemFactory.php class ItemFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = I...
Dumont asked 10/9, 2020 at 7:4

1

Solved

I want to start using tinker to debug functions much faster. The issue is that for every change I need to stop and start tinker again. I'm hoping I can use something like you have with mysql; you c...
Flyblown asked 15/4, 2021 at 10:53

1

Solved

I used to execute tinker on previous Amazon AMI by using this command : sudo -E -u webapp php artisan tinker Now I am using PHP 7.4 on Amazon Linux 2 and when I execute the above command, I get ...

2

I'm trying to make a simple class in a fresh-installed Laravel. For this I have created a folder app/Convert and put the php-file there. The class looks like this: <?php namespace App\Convert...
Edrick asked 8/7, 2018 at 14:54

3

Solved

I have two database connections. One for my application and another for testing. In my ..\config\database.php 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), ...
Stingo asked 4/4, 2018 at 11:32

4

Solved

I'm getting started with a Laravel 5 project and trying to run some experiments using 'php artisan tinker' (psy shell), but I'm running into some weirdness. In the tinker/psy shell, pressing any of...
Anneal asked 26/2, 2015 at 3:2

2

Solved

I haven't had this problem before, but my php artisan tinker crashes from issuing any command - and leaves no logs whatsoever on what is causing the crash. project4 $ php artisan tinker Psy Shell ...
Premises asked 14/12, 2018 at 3:25

1

Solved

I have been searching for hours now but cannot find a solution even though there are similar problems out there. I am trying to run php artisan tinker on a fresh laravel installation with user web...
Deidradeidre asked 17/1, 2018 at 14:17

3

Solved

I can get the first user, who is an admin in Laravel's tinker using the following command: $adminUser = App\User::where('is_admin',true)->first(); How do I get all the users which meet this wh...
Stepp asked 17/5, 2018 at 7:28

1

Solved

From within Tinker I am trying to: >>> Auth::loginUsingId(12); => false >>> Auth::user(); => null >>> Auth::attempt(['email' => '[email protected]']); =&gt...
Bevel asked 24/1, 2018 at 16:23

1

Solved

I just added tinker to my Laravel project 5.4. When I try to run: php artisan tinker I am getting following error: PHP Warning: Uncaught ErrorException: require(/home/abdullah/php_apps/website)...
Isoline asked 16/8, 2017 at 14:24
1

© 2022 - 2024 — McMap. All rights reserved.