Could someone help me with a small nuxt project?

|
skys215 2019-06-17 20:31:36
route is a path based on the domain name
chicchik 2019-06-17 23:22:32
Hello to everybody. I’m a newbie italian laravel programmer. I am creating a small app for cataloging sporting events. This is my database schema (graphical mad with laravelsd)
chicchik 2019-06-17 23:22:44
laravel_discuss-7341.jpg

chicchik 2019-06-17 23:22:59
There are my migration
<?php

use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;

class CreateSportsTable extends Migration {

public function up()
{
Schema::create(‘sports’, function(Blueprint $table) {
$table->increments(‘id’);
$table->string(‘SportName’, 50)->unique();
$table->timestamps();
});
}

public function down()
{
Schema::drop(‘sports’);
}
}

<?php

use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;

class CreateNationsTable extends Migration {

public function up()
{
Schema::create(‘nations’, function(Blueprint $table) {
$table->increments(‘id’);
$table->integer(‘sports_id’)->unsigned();
$table->string(‘Nome’, 50);
$table->timestamps();
});
}

public function down()
{
Schema::drop(‘nations’);
}
}

<?php

use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;

class CreateCompetitionsTable extends Migration {

public function up()
{
Schema::create(‘competitions’, function(Blueprint $table) {
$table->increments(‘id’);
$table->integer(‘sport_id’)->unsigned();
$table->integer(‘nations_id’)->unsigned();
$table->string(‘NomeCompetizione’, 50);
$table->timestamps();
});
}

public function down()
{
Schema::drop(‘competitions’);
}
}

chicchik 2019-06-17 23:23:17
An there my Model
<?php

namespace App;

use IlluminateDatabaseEloquentModel;

class Sport extends Model
{
protected $guarded = [];

public function nations()
{
return $this->hasMany(‘Nation’);
}

public function competitions()
{
$this->hasMany(‘Competition’);
}

}

<?php

namespace App;

use IlluminateDatabaseEloquentModel;

class Nation extends Model
{
protected $guarded = [];

public function sport()
{
return $this->belongsTo(‘AppSport’,’sports_id’);
}

public function competitions()
{
$this->hasMany(‘Competition’);
}
}

<?php

namespace App;

use IlluminateDatabaseEloquentModel;

class Competition extends Model
{
protected $guarded = [];

public function nation(){
$this->belongsTo(‘AppNation’, ‘nations_id’);
}

public function sport()
{
$this->belongsTo(‘AppSport’,’sport_id’);
}
}

chicchik 2019-06-17 23:23:40
I have a problem with my controller’s index method, so stated

public function index()
{
$competitions=Competition::all();
return view(‘elementi.competitions.index’, compact(‘competitions’));
}

chicchik 2019-06-17 23:23:53
which goes to call up the following view

@extends(‘layouts.app’)

@section(‘title’,’Lista Competizioni’)

@section(‘content’)
<div class=”row”>
<div class=”col-12″>
<h1>Competizioni</h1>
<p><a href=”competitions/create”>Aggiungi Nuova Competizione</a> </p>
</div>
</div>

<hr>

@foreach($competitions as $competition)
<div class=”row”>
<div class=”col-2″>
{{ $competition->id }}
</div>
<div class=”col-2″>{{ $competition->sport->SportName }}</div>
<div class=”col-2″>{{ $competition->nation->Nome }}</div>
<div class=”col-2″>
<a href=”/competitions/{{ $competition->id }}”>{{ $competition->NomeCompetizione }}</a>
</div>

</div>
@endforeach

@endsection

chicchik 2019-06-17 23:24:05
As long as the competition table is empty no problem. The writing of the record does not give me problems, but when it has to re-display index it returns to me

ErrorException (E_ERROR)
AppCompetition::sport must return a relationship instance. (View: D:laravelbetregisterresourcesviewselementicompetitionsindex.blade.php)

chicchik 2019-06-17 23:24:13
But I don’t know why. Indicates that there is no relationship between the two tables, when there is. Some advice? Thanks a lot.
oxbir 2019-06-17 23:30:21
How to save checkboxes to foreach displayed?
DesolatorMagno 2019-06-17 23:51:47
chicchik 2019-06-17 23:24:13
But I don’t know why. Indicates that there is no relationship between the two tables, when there is. Some advice? Thanks a lot.

You must be hungry, because you eat away a lot of return from those function.

oxbir 2019-06-17 23:57:07
oxbir 2019-06-17 23:30:21
How to save checkboxes to foreach displayed?

؟

DesolatorMagno 2019-06-17 23:59:08
Look at the relations, you are not returning the majority.
drgflorin 2019-06-18 00:53:27
laravel_discuss-7353.jpg

ransikoo 2019-06-18 06:03:21
how when user login to websit and user visit login page> redirect to home and not show login page ?
DesolatorMagno 2019-06-18 06:32:16
Because that is where it say it should go after sucessufull login, look at the controller.
loveycom 2019-06-18 06:52:07
chicchik 2019-06-17 23:23:17
An there my Model
<?php

namespace App;

use IlluminateDatabaseEloquentModel;

class Sport extends Model
{
protected $guarded = [];

public function nations()
{
return $this->hasMany(‘Nation’);
}

public function competitions()
{
$this->hasMany(‘Competition’);
}

}

<?php

namespace App;

use IlluminateDatabaseEloquentModel;

class Nation extends Model
{
protected $guarded = [];

public function sport()
{
return $this->belongsTo(‘AppSport’,’sports_id’);
}

public function competitions()
{
$this->hasMany(‘Competition’);
}
}

<?php

namespace App;

use IlluminateDatabaseEloquentModel;

class Competition extends Model
{
protected $guarded = [];

public function nation(){
$this->belongsTo(‘AppNation’, ‘nations_id’);
}

public function sport()
{
$this->belongsTo(‘AppSport’,’sport_id’);
}
}

Add return before $this->belongsTo

2019-06-18 06:54:41
Does anybody know which is best package for authorization and role permission management in laravel.. please..
htoowaikhant 2019-06-18 08:25:54
if u just start learn about ACL package, check out the https://github.com/Zizaco/entrust. This package provides a flexible way to add Role-based Permissions and can easy use to your application. Or u already have experience of ACL package , just dive to https://github.com/spatie/laravel-permission. Spatie Roles & Permission is one of there best permissions package. It has a lot of feature.

GitHub – Zizaco/entrust: Role-based Permissions for Laravel 5GitHub
Role-based Permissions for Laravel 5. Contribute to Zizaco/entrust development by creating an account on GitHub.
2019-06-18 09:02:48
2019-06-18 06:54:41
Does anybody know which is best package for authorization and role permission management in laravel.. please..

Laravel spatie permissions can work with vuejs as well just manipulation

oxbir 2019-06-18 09:27:17
How to create send code again?

I want to create verification code again? I think the code should update.

[![sendsode][1]][1]

I get this error.

[![404][2]][2]

[1]: https://i.stack.imgur.com/rg2kY.png
[2]: https://i.stack.imgur.com/ocMQq.png

Look at my code

web.php

Route::post(‘/send-again-code’, ‘HomeController@sendAgainCode’)->name(‘sendAgainCode’);

HomeController.php

public function sendAgainCode ()
{
$code = rand(1000,9999);

try {
$api = new KavenegarKavenegarApi(“Api Key”);
$sender = “10004346”;
$message = $code;
$receptor = auth()->user()->mobile;
$result = $api->Send($sender, $receptor, $message);
if ($result) {
foreach ($result as $r) {
echo “messageid = $r->messageid”;
echo “message = $r->message”;
echo “status = $r->status”;
echo “statustext = $r->statustext”;
echo “sender = $r->sender”;
echo “receptor = $r->receptor”;
echo “date = $r->date”;
echo “cost = $r->cost”;
}
}
} catch (KavenegarExceptionsApiException $e) {
echo $e->errorMessage();
} catch (KavenegarExceptionsHttpException $e) {
echo $e->errorMessage();
}
}

2019-06-18 09:42:37
htoowaikhant 2019-06-18 08:25:54
if u just start learn about ACL package, check out the https://github.com/Zizaco/entrust. This package provides a flexible way to add Role-based Permissions and can easy use to your application. Or u already have experience of ACL package , just dive to https://github.com/spatie/laravel-permission. Spatie Roles & Permission is one of there best permissions package. It has a lot of feature.

Thanxx brother…

2019-06-18 09:42:52
2019-06-18 09:02:48
Laravel spatie permissions can work with vuejs as well just manipulation

Thanxx brother..

2019-06-18 09:44:47
What do you think about Laratrust.. for acl
wergutinec 2019-06-18 11:12:26
….
Thainvnv 2019-06-18 12:41:10
I’m using multi queue laravel and I have a error :

serialize(): “cache” returned as member variable from __sleep() but does not exist {“exception”:”[object] (ErrorException(code: 0): serialize(): “cache” returned as member variable from __sleep() but does not exist at /data/www/dev-bot.platformjk.com/vendor/laravel/framework/src/Illuminate/Queue/Queue.php:138)

I don’t know why so please give me a solution .Thank you

chicchik 2019-06-18 13:46:08
DesolatorMagno 2019-06-17 23:59:08
Look at the relations, you are not returning the majority.

Oh my God. what a stupid mistake. thank you very much for the tip

Harrisdtt 2019-06-18 13:53:27
laravel_discuss-7398.jpg
hello every one please tell me how do i dynamically add this number to size
hamidshariati_ir 2019-06-18 13:54:57
Harrisdtt 2019-06-18 13:53:27
hello every one please tell me how do i dynamically add this number to size

where do you fill ‘number’ dynamically?

Harrisdtt 2019-06-18 13:56:42
i need to do the size of code depend upon number
if number is 5 then the size of the code would be 5 depend upon post[‘number’]
hamidshariati_ir 2019-06-18 13:57:15
StanleyMasinde 2019-06-15 12:17:24
Configuring Auth Guards For Multiple Users in Laravel
https://medium.com/@tomgrohl/configuring-auth-guards-for-multiple-users-in-laravel-6b845178e414

tnx

pushpak1300 2019-06-19 04:47:40
Anyone has hosting experience on heroku?
skys215 2019-06-19 04:55:20
Nope, just ask your question, those who knows will answer you
ransikoo 2019-06-19 05:56:20
how to create ajax search in laravel ?
Thainvnv 2019-06-19 07:50:44
I’m using multi queue laravel and I have a error :

serialize(): “cache” returned as member variable from __sleep() but does not exist {“exception”:”[object] (ErrorException(code: 0): serialize(): “cache” returned as member variable from __sleep() but does not exist at /data/www/dev-bot.platformjk.com/vendor/laravel/framework/src/Illuminate/Queue/Queue.php:138)

I don’t know why so please give me a solution .Thank you

2019-06-19 14:22:22
Could someone help me with a small nuxt project? I just have to replace 6 texts in the html page but do not have my laptop with me 😩
hamidshariati_ir 2019-06-19 14:23:55
hi there, I’m using laravel authentication with custom table. when trying attemptlogin from authcontroller redirected correctly but without Auth::user() (null)!!! what’s my mistake?
Severusxyz 2019-06-19 21:21:24
ransikoo 2019-06-19 05:56:20
how to create ajax search in laravel ?

What about vue

Severusxyz 2019-06-19 21:34:35
Harrisdtt 2019-06-18 13:53:27
hello every one please tell me how do i dynamically add this number to size

You mean random?

Emma250 2019-06-19 21:36:01
It will automatic create everything for you
Emma250 2019-06-19 21:36:01
Usr laragon
DesolatorMagno 2019-06-19 21:38:40
Harrisdtt 2019-06-18 13:53:27
hello every one please tell me how do i dynamically add this number to size

https://laravel.com/docs/5.6/validation#available-validation-rules

Laravel – The PHP Framework For Web ArtisansLaravel
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation β€” freeing you to create without sweating the small things.
DesolatorMagno 2019-06-19 21:39:42
laravel_discuss-7445.jpg
In that part is every rules, not all of them have examples, but google is your friend, for example this teach you how to use unique.
DesolatorMagno 2019-06-19 21:43:00
Now, you also have access to the request inside the validation, so you could do

‘size:’ . $request->input(‘number’) . ‘…’

2019-06-19 22:55:30
laravel_discuss-7447.jpg

Harrisdtt 2019-06-20 05:20:27
Severusxyz 2019-06-19 21:34:35
You mean random?

yes random ‘size’ of $POST[‘code’] depends upon $POST[‘number’];

ransikoo 2019-06-20 06:44:57
Severusxyz 2019-06-19 21:21:24
What about vue

no. work with just laravel

2019-06-20 12:31:02
Hey guys this is not a laravel problem. How can I embed hotels nearby a certain location in website?
sunny 2019-06-20 12:39:29
😍😍INSTAGRAM SERVICES 😍😍

INSTA VIP FOLLOWERS RATE
1k=Rs159
2k=Rs259
3k=Rs359
4k=Rs459
5k=Rs559
6k=Rs659
———————————————————-
INSTA FOLLOWERS
1k=Rs79
2k=Rs149
3k=Rs229
4k=Rs319
5k=Rs389
———————————————————-
INSTA LIKES RATE
1k=Rs39
2k=Rs79
3k=Rs119
4k=Rs159
5k=Rs189
———————————————————-
INSTA VIEWS RATE
1k=Rs5
2k=Rs10
3k=Rs15
4k=Rs20
5k=Rs25
———————————————————-
INSTA COMMENTS
1k=Rs199
2k=Rs399
3k=Rs599
4k=Rs799
5k=Rs999
———————————————————-
😍😍FACEBOOK SERVICES 😍😍

Page likes = Rs749/1000
Video views=Rs89/1000
———————————————————-
😍😍YOUTUBE SERVICES 😍😍

SUBSCRIBERS=Rs1251.30/1000
YOUTUBE VIEWS=Rs179/1000
SHARES=Rs119/1000
———————————————————-
😍😍TIKTOK SERVICES 😍😍

VIDEO SHARES=Rs39/1000
LIKES=Rs 559/1000
FAST FOLLOWERS= Rs559/1000
SLOW FOLLOWERS= Rs199/1000
———————————————————-
😍😍 TELEGRAM SERVICES 😍😍

CHANNEL MEMBERS= Rs189/1000
GROUP MEMBERS= Rs419/1000
POST VIEWS[Last 10]= Rs219/1000
POST VIEWS[Last 20]= Rs299/1000

———————————————————-

DM me
πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

Severusxyz 2019-06-20 14:29:17
Harrisdtt 2019-06-20 05:20:27
yes random ‘size’ of $POST[‘code’] depends upon $POST[‘number’];

Huh. But you are trying to create tables dynamically? But migration is before having a app aldeady. You can’t use it

|