Can you help me with this question?

|
. 2020-07-01 21:54:44
Vue
Lisendra 2020-07-02 01:45:02
I am trying to seed an admin user after migration, and i implemented the method UpdateorInsert , nonetheless i can seed it one time, then it fail a second time saying the id is taken instead of just updating it, here is my seed logic:
<?php

use IlluminateDatabaseSeeder;

class adminseed extends Seeder
{
public function run()
{
DB::table(‘users’)->updateOrInsert([
‘id’ =>’1′,
‘full_name’ => ‘Sysadmin’,
’email’ => ‘example@gmail.com’,
‘password’ => Hash::make(‘12345678’),
‘role_id’ => ‘3’,
‘img_path’ => ‘user-lg.jpg’,
]);
}
}

pmdev01 2020-07-02 03:10:24
DesolatorMagno 2020-06-19 02:45:52
Yes, but as side note, they are not exactly the same thing.

hello geek i use laravel version 7 and i want to redirect my login admin if i logout , i use handle from exception folder

pmdev01 2020-07-02 03:15:34
<?php

namespace AppExceptions;

use Exception;
use IlluminateAuthAuthenticationException;
use IlluminateFoundationExceptionsHandler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
IlluminateAuthAuthenticationException::class,
IlluminateAuthAccessAuthorizationException::class,
SymfonyComponentHttpKernelExceptionHttpException::class,
IlluminateDatabaseEloquentModelNotFoundException::class,
IlluminateSessionTokenMismatchException::class,
IlluminateValidationValidationException::class,
];

/
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/
* Render an exception into an HTTP response.
*
* @param IlluminateHttpRequest $request
* @param Exception $exception
* @return IlluminateHttpResponse
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}

/
* Convert an authentication exception into an unauthenticated response.
*
* @param IlluminateHttpRequest $request
* @param IlluminateAuthAuthenticationException $exception
* @return IlluminateHttpResponse
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json([‘error’ => ‘Unauthenticated.’], 401);
}

$guard = array_get($exception->guards(),0);

switch ($guard) {
case ‘admin’:
return redirect()->guest(route(‘admin.login’));
break;

default:
return redirect()->guest(route(‘login’));
break;
}

}
}

pmdev01 2020-07-02 03:16:59
before laravel 7 like laravel 5.X in handle class from exeptions folder we have unauthenticated function in laravel 7 i don’t have this default methode
Lisendra 2020-07-02 03:17:46
you want to force login ?
pmdev01 2020-07-02 03:20:04
i have created admins model and a create for post tag et categorie a constructor for the middleware.
pmdev01 2020-07-02 03:20:53
plz help me i don’t know what kind of method or function do you use to redirect at login page after logout
Lisendra 2020-07-02 03:22:39
in you controller :
public function __construct()
{
$this->middleware(‘auth’);
}
and in your route something like :
Route::get(‘(your admin page route)’, [
‘middleware’ => ‘auth’,
‘uses’ => ‘AdminController@index’
]);
Lisendra 2020-07-02 03:23:02
it’s just an idea, better check for more details https://laravel.com/docs/master/authentication
pmdev01 2020-07-02 03:26:05
this is HomeController
pmdev01 2020-07-02 03:28:31
Lisendra 2020-07-02 03:22:39
in you controller :
public function __construct()
{
$this->middleware(‘auth’);
}
and in your route something like :
Route::get(‘(your admin page route)’, [
‘middleware’ => ‘auth’,
‘uses’ => ‘AdminController@index’
]);

ok i have do it for any Controller like

pmdev01 2020-07-02 03:30:27
class PostController extends Controller
{

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(‘auth:admin’);
}

pmdev01 2020-07-02 03:33:20
laravel_discuss-43505.jpg
i get this page when i logout
pmdev01 2020-07-02 03:35:31
thanks a lot
web_artisan77 2020-07-02 06:10:31
can you help me with this question? stackoverflow (dot.) /questions/62687702/graphql-w-laravel-lighthouse-belogsto-same-model
web_artisan77 2020-07-02 06:11:16
I’m trying to use the @belongsTo relation in lighthouse (graphQL)
doempechvathna 2020-07-02 07:25:34
laravel_discuss-43516.jpg
what can i do for this case. please help me fix it
skys215 2020-07-02 07:29:05
doempechvathna 2020-07-02 07:25:34
what can i do for this case. please help me fix it

View log for more informaion

doempechvathna 2020-07-02 07:31:15
skys215 2020-07-02 07:29:05
View log for more informaion

how

doempechvathna 2020-07-02 07:33:33
laravel_discuss-43519.jpg

skys215 2020-07-02 07:36:53
doempechvathna 2020-07-02 07:31:15
how

storage/logs/

Sa2od 2020-07-02 08:31:47
Want to build my own MVC classes using pure php
Do anyone have book or source to learn from
Thnx
Siberfx 2020-07-02 09:50:46
Sa2od 2020-07-02 08:31:47
Want to build my own MVC classes using pure php
Do anyone have book or source to learn from
Thnx

Waste of time.. learn one of the most popular framework and be happy

. 2020-07-02 09:51:25
Sa2od 2020-07-02 08:31:47
Want to build my own MVC classes using pure php
Do anyone have book or source to learn from
Thnx

oop in php, find course in udemy

Siberfx 2020-07-02 09:52:05
Come on.. i have 2 different mvc systems, but never using 🙂
oluleye oluseun 2020-07-02 09:59:53
laravel_discuss-43526.jpg

oluleye oluseun 2020-07-02 10:03:06
Am this problem with my xampp. Pls i need solution ASAP
Sa2od 2020-07-02 10:04:08
Siberfx 2020-07-02 09:50:46
Waste of time.. learn one of the most popular framework and be happy

I thought it’ll be better for me to create one to improve my skills

Sa2od 2020-07-02 10:04:19
. 2020-07-02 09:51:25
oop in php, find course in udemy

Thank u

Siberfx 2020-07-02 10:05:48
Sa2od 2020-07-02 10:04:08
I thought it’ll be better for me to create one to improve my skills

to improve your skills, you can use php quiz system, test your knowledge and when you fail, at least you will know what to improve 🙂

Siberfx 2020-07-02 10:06:05
find the missing stuffs by simple tests.
Siberfx 2020-07-02 10:06:24
well its my advise.. if you are interested to that way.
krishantalwar 2020-07-02 10:11:50
Sa2od 2020-07-02 08:31:47
Want to build my own MVC classes using pure php
Do anyone have book or source to learn from
Thnx

U cAn watch this person vidoes https://www.youtube.com/user/JREAMdesign

Sa2od 2020-07-02 10:14:32
Siberfx 2020-07-02 10:06:24
well its my advise.. if you are interested to that way.

Thanks, i appreciate it

doempechvathna 2020-07-02 11:53:12
Why it have mistake. I just laravel new project
Siberfx 2020-07-02 11:59:00
doempechvathna 2020-07-02 11:53:12
Why it have mistake. I just laravel new project

and it means you also have a new laravel error

yunartyom 2020-07-02 12:36:23
laravel_discuss-43540.jpg
Does somebody know? Why artisan migrate don’t work? I’ve uncommented all exceptions but it didn’t help to me:(
skys215 2020-07-02 12:39:03
What’s your db_connection in .env
yunartyom 2020-07-02 12:43:32
Just MySQL
skys215 2020-07-02 12:44:10
Did you install pdo_mysql?
Rajat Agrawal 2020-07-02 12:44:22
laravel_discuss-43544.jpg

Rajat Agrawal 2020-07-02 12:44:49
Rajat Agrawal 2020-07-02 12:44:22

not able to convert the image to base 64

yunartyom 2020-07-02 12:45:37
skys215 2020-07-02 12:44:10
Did you install pdo_mysql?

Of course

Rajat Agrawal 2020-07-02 12:45:37
any body who can resolve my issue
yunartyom 2020-07-02 12:46:11
yunartyom 2020-07-02 12:45:37
Of course

Wait, I’m checking it

skys215 2020-07-02 12:47:15
Rajat Agrawal 2020-07-02 12:44:49
not able to convert the image to base 64

The error is obvious

Rajat Agrawal 2020-07-02 12:47:34
skys215 2020-07-02 12:47:15
The error is obvious

what

skys215 2020-07-02 12:47:37
yunartyom 2020-07-02 12:46:11
Wait, I’m checking it

And did you enabled it? And restart after enabling it

skys215 2020-07-02 12:47:48
Rajat Agrawal 2020-07-02 12:47:34
what

Filename cannot be empty

|