Questions tagged [tinker]

Tinker is a REPL for the Laravel PHP framework.

136 questions
0
votes
3 answers

How to fill Request object in command line REPL tool Tinker with emulated data of real http request

Using Laravel framework and it's REPL named Tinker in my project, I want to set the request object to the same state it would be if I made some real HTTP request through my browser. When I dump the request using dd($request); I receive a lot of…
Ilya Kolesnikov
  • 623
  • 8
  • 17
0
votes
1 answer

Laravel Getting Error When Running Tinker

I'm using Laravel 5.2 and PHP 7.1, but I get an error when I'm trying to use Tinker. When I run: php artisan tinker I get the following error: [Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined function…
Nilay Singh
  • 2,201
  • 6
  • 31
  • 61
0
votes
2 answers

Running Laravel Tinker in Terminal Only Exits

Laravel Tinker runs in Terminal, but anytime I try to get it to compute anything it exits and returns to the command line. This is a typical terminal command which I try, and Tinker exits without doing anything every time I press the Enter…
0
votes
0 answers

Fix "This channel is already in use" on Tinkerboard (Python)

I am trying to port an example for a Mifare RFID Card reader from Raspberry to the Tinkerboard. The program works, and the RFID Cards are accepted. However, the RESET functionality is not working. There is a warning that says that the channel 22 is…
0
votes
1 answer

laravel factory Illuminate/Database/QueryException with message 'SQLSTATE[HY000]:

the problem is that tinker is not wrapping the content in a string Illuminate/Database/QueryException with message 'SQLSTATE[HY000]: General error: 1364 Field 'address_line_2' doesn't have a default value (SQL: insert into Test (name, gender,…
Marcogomesr
  • 2,614
  • 3
  • 30
  • 41
0
votes
4 answers

Laravel not getting info out of database, displays erros

Sorry, I'm new to developing on Laravel. I'm trying to show info contained in the database on my page. But it can't find the variable holding all the data. I can see the info in Tinker, but i can't seem to deplay is. I posted some pictures so you…
STechmo
  • 3
  • 2
0
votes
0 answers

PHP artisan tinker, GROUP BY - aggregate NOT Working but working with SQL as Sql Query inside Management Studio

I have a query SQL Query SELECT YEAR(created_At) [YEAR], MONTH(created_at) [MONTH], COUNT(*) as Published_Articles FROM dbo.tasks GROUP BY YEAR(created_At), MONTH(created_at) Which produces correct result when asked to run in Management…
0
votes
0 answers

powershell doesn't display or output boolean and increments values

I use virtual machine and homestead with virtualbox under windows 10. When i run php artisan tinker and try to find user with App\User::first(), it returns: Psy Shell v0.8.17 (PHP 7.1.7-1+ubuntu16.04.1+deb.sury.org+1 — cli) by Justin Hileman >>>…
Wayne JP
  • 1
  • 2
0
votes
1 answer

Laravel commands like tinker

I am wondering if there's any way to run an ad-hoc command in laravel? like in tinker, but without tinker? I want to be able to run an ad-hoc command but without using tinker ? Example: "App\Post::orderBy('timestamp', 'desc')->first()" I want to…
user7175325
0
votes
1 answer

Laravel Tinker creating new object that have constructer as an interface

I am trying to use Laravel Tinker to create a new object that have a constructer as an interface. MyClass.php class MyClass{ public function __construct(ApiInterface $APIloader) { $this->APIloader = $APIloader; …
daniel8x
  • 990
  • 4
  • 16
  • 34
0
votes
1 answer

How to seed a database dummy data using tinker with two each loops - Laravel PHP

I try to seed my mysql database with tinker commands and are struggeling combining two each loops... I have a table movies, users, and ratings. I want to seed the database with 10 movies, 3 users, and for each user a rating for each movie. I am…
Marco
  • 319
  • 4
  • 13
0
votes
3 answers

Laravel tinker mode

If I run php artisan tinker the CLI will open with Psy Shell v0.8.6 (PHP 7.0.8 — cli) by Justin Hileman >>> Now I enter a word like 'test' and press the return key. What mode did I enter? How can I exit this mode? (ctrl+c exits tinker, but…
Andreas
  • 687
  • 2
  • 9
  • 20
-1
votes
1 answer

SQLSTATE[42S02] Problem with artisan tinker

I have a problem with artisan tinker Problem: Illuminate\Database\QueryException with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.projects' doesn't exist (SQL: insert into `projects` (`title`, `description`,…
Mineral
  • 39
  • 1
  • 1
  • 7
-1
votes
2 answers

Using the tinker function in laravel

Im using the tinker function in laravel but when i type the following in: >>>user App\PostController; >>>PostController::get(); I get the following error: PHP Fatal error: Class 'App/PostController' not found in Psy Shell code on line 1 How do i…
Gino Sesia
  • 383
  • 2
  • 4
  • 14
-1
votes
1 answer

build artisan query from normal sql query

I have a query in normal SQL below and I want to change it into artisan tinker query, select count(P.id), DATEDIFF(P.tarehe_ya_kujifungua,P.tarehe_ya_kuzaliwa) as umri from postnatals P INNER JOIN register13s R ON P.namba_ya_kadi_RCH4 =…
Angelwise
  • 101
  • 1
  • 5
1 2 3
9
10