Twittler

Experience

550

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 2 Lessons Completed
  • 0 Favorites

12th July, 2018

Twittler started a new conversation Laravel Error While Migrating 2002 • 1 week ago

Hi guys, i'm using MAMP for database, and i just can't migrate databases, i dont know why i tried DB_HOST=localhost, DB_HOST=127.0.0.1. And it all the same, here the code what i'm using:

.env: DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=root

database.php

'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '3306'), 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', 'database' => env('DB_DATABASE', 'test'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', 'root'), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => null, ],

and i'm getting error:

php artisan migrate

Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table users (id int unsigned not null auto_increment primary key, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null, remember_token varchar(100) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

at /Applications/MAMP/htdocs/RunescapeTips/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists") /Applications/MAMP/htdocs/RunescapeTips/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458

2 PDOStatement::execute() /Applications/MAMP/htdocs/RunescapeTips/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458

Any help? thanks.

21st June, 2018

Twittler left a reply on Laravel Undefined Variable: • 1 month ago

Yeah guys thank you all very much, that was silly me, i forgot to change route to Route::get('/list', '[email protected]');

Thank you all.

Twittler left a reply on Laravel Undefined Variable: • 1 month ago

yeah it has no data ;/

Twittler left a reply on Laravel Undefined Variable: • 1 month ago

Thats even dummier question from me where i suppose to put this

$posting = posting::all(); dd($posting)

in controller like this?

    $posting = posting::all();
    dd($posting)
    return view("lists.list",compact("posting"));

Twittler started a new conversation Laravel Undefined Variable: • 1 month ago

Hi guys, just got a nooby problem, i cant fetch data from db, but the strange thing is in other folder i used

Controller:

    $hosting = hosting::all() -> toArray();
    return view("index",compact("hosting"));

View:

@foreach($hosting as $host) {{$host['pavadinimas']}} @endforeach

And that worked, right now i want to make a list and i using

Controller:

    $posting = posting::all() -> toArray();
    return view("lists.list",compact("posting"));

View:

@foreach($posting as $post)

<p>{{$post['vardas']}}</p>
@endforeach 

and it;s giving me error " Undefined variable: posting (View: C:\xampp\htdocs\praktika1\resources\views\lists\list.blade.php)"

and i don't understand what i have done wrong?

18th June, 2018

Twittler left a reply on Sending Email With Expiration_date • 1 month ago

When i try run it i get

          • php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1 Cannot run program "*" (in directory "C:\xampp\htdocs\praktika1"): CreateProcess error=2, The system cannot find the file specified

Twittler left a reply on Sending Email With Expiration_date • 1 month ago

So i created command with

php artisan make:command EmailSent --command=email:sent

and having

Twittler started a new conversation Sending Email With Expiration_date • 1 month ago

Hi guys, need some advice once again, i have database with created_at and expiration_date, how do i send email when date expires?

17th June, 2018

Twittler started a new conversation Integrity Constraint Violation: 1452 Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails • 1 month ago

Hi guys, i'm having " Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails" problem when i try to send data to database.

11th June, 2018

Twittler started a new conversation How To Send Email When Subscription Ends? • 1 month ago

Hi guys, can you help me? How do i send email when users subscription ends?

Sorry for that dumb question i'm new to laravel ;/

Thanks.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.