المشاركات

عرض المشاركات من مايو, 2020

PHP Array Improvement

Quick question, most likely for a veteran will be easy, or maybe im asking for too much. i have this code for laravel in php, im not fan to do a foreach, is there a better way? i guess should be an existing function that replace my values of arr to the keys match on arr2, but i dont know Its really important not to change the order. $arr= ['filters', 'repeat', 'via', 'type']; $arr2= [ 'filters' => 'text1', 'repeat' => 'text2', 'via' => 'text3', 'type' => 'text4', ]; foreach($arr as $k) $res[]=$arr2[$k]; return $res; from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LhpNSB via IFTTT

Displaying breadcrumbs in Laravel

I am beginner in Laravel. I use in my project Laravel 6. I have this migration: public function up() { Schema::create('product_categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->char('enable', 1)->default(0); $table->string('name', 85)->nullable(); $table->string('url_address', 160); $table->integer('level')->default(0); $table->unsignedBigInteger('parent_id')->nullable(); $table->foreign('parent_id')->references('id')->on('product_categories')->onDelete('cascade'); $table->bigInteger('number')->default(0); $table->engine = "InnoDB"; $table->charset = 'utf8mb4'; $table->collation = 'utf8mb4_unicode_ci'; }); } In controller I Hav...

Laravel: How to access controller function from webhook I created to catch Stripe events?

For new credit cards, I used to tokenize the card and then charge it. I had a function inside my CheckoutController.php that trigger the flow: public function checkoutWithNewCard(Request $request) { $total = $request->input('total'); $customer = $request->user(); $customer->checkout()->createOrder($request->input('total') } createOrder() also create the order on my backend and clears the cart so it needs to run. I have no switched to using Stripe's new hosted Checkout so a customer is now sent to stripe's own checkout form and upon success, sent back to my site and I am using a webhook to catch checkout.session.completed event. I have a StripeController.php for my webhooks and tested this properly. I had a log statement inside checkout.session.completed upon checkout and it fires properly. StripeController.php <?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Jobs\Co...

insert in another table when login laravel 5.2

i use auth default login in laravel 5.2, but i want when login to update or insert in another table on every user login i want to insert this when user login $sql = Counts::where('client_id', Auth::user()->id)->get(); if (sizeof($sql) == 0) { $sql = new Counts(); $sql->client_id = Auth::user()->id; $sql->save(); } Auth/Authcontroller.php dont have login method... can someone help me please ? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2zcNngs via IFTTT

Paratests: DB fails to respond

I am running laravel 6.* and I am having issue with brianium/paratest 2.*. When I run paratests ( .\vendor\bin\paratest ) I keep seeing alot of error message such as: \vendor\laravel\framework\src\Illuminate\Database\Connection.php(629): Illuminate\Database\Connection->runQueryCallback('insert into `ro...', Array, Object(Closure)) Issue is to do with me using a single database. So, the question is is there away to spin up multiple test databases? In my pipeline script that I use on bitbucket I set mysql using code below: mysql: image: mysql:5.7 memory: 512 tmpfs: /var/lib/mysql restart: always Not sure on where to go for here... from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2A2KAXz via IFTTT

AWS - MediaConvert - How delete input after the conversion?

Is it possible to set some configuration to remove the files at the end of a conversion job? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2YBUoSz via IFTTT

How can I update quantity of particular session array data inside foreach loop .in laravel. Here is my code where I want to make changes

$result = Product::where('id','=',$pid)->get(); foreach($result as $val) { $itemArray[$val->product_name] = [ 'id' => $val->id, 'product_name'=>$val->product_name, 'price'=>$val->price, 'qty'=>$qty, 'main_image'=>$val->main_image ]; if($request->session()->has('cart_item')) { if(in_array($val->product_name,array_keys($request->session()->get('cart_item')))) { foreach($request->session()->get('cart_item') as $key=> $vals) { if($val->product_name == $key) { // Here i just want to add quantity.. Pls hep } } } else{ $request->session()->put('cart_item',array_merge($request->session()->get('cart_item'),$itemArray)); } } else { $request->session()->put('cart_item', $itemArray); } } from Newest questions tagged laravel-5 -...

How to document a callback using DarkaOnLine / L5-Swagger in Laravel 5.8

I need to document a callback, I tried something like this but it doesn't work: /** * @OA\Post( * path="/myurl-service", * operationId="Id", * tags={"Services"}, * summary="Summary", * description="Desc", * security={ * {"bearerAuth": {}} * }, * @OA\RequestBody( * required=true, * @OA\JsonContent(ref="#/components/schemas/Request") * ), * callbacks={ * "Notification": { * "{$request.body#/notification_url}": * @OA\Post( * @OA\RequestBody( * required=true * ), * @OA\Response( * response=200, * description="Successful operation" * ...

Laravel: Get Page views in the last 30 days

I need an output that list page views in the last 30 days. This is my structure. CREATE TABLE `view_history` ( `page_id` int(11) NOT NULL, `date` date NOT NULL, `views` int(6) DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`page_id`,`date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Controller: $pageViews = ViewHistory::where('page_id',1) ->select('date','views') ->orderBy('date','DESC') ->take(30) ->get(); Blade: @foreach($pageViews as $pageView) date: views: <br> @endforeach The output to the browser is: date: 2020-05-02 views:10 date: 2020-04-30 views:7 date: 2020-04-26 views:2 date: 2020-04-23 views:12 date: 2020-04-22 views:12 date: 2020-04-21 views:12 date: 2020-04-16 views:6 date: 2020-04-14 views:11 date: 2020-04-12 views:11 date: 2020-04-11 views:1 date: 2020-04-09 views:7...

Cannot pass full array from controller in laravel to a view using redirect()

I am unable to solve passing of array issue below is my function in controller public function fetchData($id) { $id=base64_decode(urldecode($id)); prod_detail=ProductDetail::select('prod_id','supplier_id','price','open_stock','discount_rate','min_order_level')->where('prod_id','=',$id)->get(); return redirect()->route('prod_d_view', compact($prod_detail)); } below is my route Route::get('/product_view', function(){ return view('/admin/product_d_mgt'); })->name('prod_d_view'); below is my error Undefined variable: prod_detail (View: \admin\product_d_mgt.blade.php) I am unable to pass the full array from one controller using redirect()->route() to another view from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2A1pnxb via IFTTT

Multiple Laravel Project on Same Single Server in VPS Provision

I have one VPS with operating system Centos 7. I want to run multiple Laravel project on same sever so, how can I do that with LAMP server? My single laravel project run perfectly but multiple laravel project are not working. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35yk1oI via IFTTT

Laravel 5.5 - Get specific row in duplicate row

Let's say i have a user table like this : +----+-----------+---------+------------+------+ | ID | Name | Email | Age | +----+-----------+---------+------------+------+ | 1 | John | john.doe1@mail.com | 24 | | 2 | Josh | josh99@mail.com | 29 | | 3 | Joseph | joseph410@mail.com | 21 | | 4 | George | gge.48@mail.com | 28 | | 5 | Joseph | jh.city89@mail.com | 24 | | 6 | Kim | kimsd@mail.com | 32 | | 7 | Bob | bob.s@mail.com | 38 | | 8 | Joseph | psa.jos@mail.com | 34 | | 9 | Joseph | joseph.la@mail.com | 28 | | 10 | George | georgj04@mail.com | 22 | +----+-----------+---------+------------+------+ In the actual, it have more data and some of them is duplicated with more than two record, but the point is i want to get the first and the second row that have name "Joseph", but how to do it ? My code this far... User::withTrashed()->groupBy('name...

How to fetch records that specfic strings in Laravel?

صورة
I would like to fetch record that a columun has specfic strings. My Laravel framework is 5.7.28 Here is my DB. Take a look 'image' columun. For example. I would like to fetch record that 'images' name include '01' strings. I give name all image data those front 2 letters are numbers such as '01', '02', '03' .... Could you please teach me how to write controller code? Here is my current controller public function index2() { $images = ImageGallery::orderBy(DB::raw('LENGTH(image), image'))->paginate(10); return view('image-gallery2',compact('images')); } from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3fuTLAm via IFTTT

Swift10Exception: Unable to open file for reading laravel 5.8

Currently working on a platform that allows people send files to people's mail, on upload of the files, the file get stored in Amazon S3 bucket then retrieved to be sent to the email of the uploader. The issue I am having is anytime I tried to retrieve the file from Amazon S3 bucket, I get this error: "Swift10Exception: Unable to open file for reading". Document Upload Controller public function store(Request $request) { // $this->validate($request,[ 'recipient_email' => 'required', 'file' => 'required' ]); $files = $request['file']; $id = mt_rand(); if($files){ foreach($files as $file) { $docName = $file->getClientOriginalName(); $originalName = pathinfo($docName,PATHINFO_FILENAME); $extension = $file->getClientOriginalExtension(); $filename = mt_rand().'.'.$e...

How to use Request file without using it in Laravel function parameter

I have request file that I use for validation and other codes for my request. And I have some instance that I want to also use the request file. Normally I did it like this: public function myFunction(RequestFile $request) { ...doing the intended actions } On the other hand I tried to doing it like this to use my request file but it is not working: public function myFunction() { $newData = new RequestFile($data); } Is this the right way to use my request file when not using it in my function parameter? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2W5Hc6N via IFTTT

JavaScript heap out of memory while building frontend code in laravel

Suddenly I started getting this error while doing frontend scaffolding in Laravel while doing npm run dev Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory Node version: 12.16 Laravel version: 5.8 I have tried doing --max-old-space-size=8192 on npm run development like this: "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js --max-old-space-size=8192", Here is my package.json. { "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js --max-old-space-size=8192", "watch": "npm run development -- --watch", "watch-poll": "npm run wat...

How to run cron job once a job done without taking any time interval in laravel

I want to run cron job once a job is done without taking any time interval. As I know smallest time interval is 1 minute. I also made custom execution like every 20 second. By I want once a job is done it run automatically without taking any time interval. Also considering Overlapping . Thanks in advance Here is my code protected function schedule(Schedule $schedule) { $schedule->command('second:execute') ->everyMinute(); //->withoutOverlapping(); } In commands public function handle() { while (true) { \Log::useDailyFiles( storage_path() . '/logs/scheduler.log' ); \Log::info( 'Tried to send mail at: ' . date( "h:i:sa" ) . PHP_EOL ); sleep(5); } } from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2KZgzu2 via IFTTT

losing array elements after pagination in foreach

i want to show in my page books and series at the same time knowing that series have many books ,only one serie of each group of books having the same "liv_id_serie_id" is gonna be shown. So i had to use an array to store duplicates elements in it but after each pagination (infinite-scrolling pagination) i lose those elements . is there a way to keep the elements after pagination ? this is my foreach loop : @if(count($livres) > 0) <div class="card-group volet-4 infinite-scrolling "> <div class="card-columns"> @foreach($livres as $livre) @if($livre->liv_id_serie_id==null) <div class="card card-volet4"> <img class="card-img-top" src="..." alt="Card image cap"> <div class="card-block"> <h4 class="card-title"></h4> <...

Add a class to header when url path changes in Laravel 6.2

How can I add a class when I navigate to the individual blog pages. For example when a user comes to the Home page the header color should be gold and when the user navigates to each and every single blogs the header background color should be red. I have done it this way, where I need to add the url path to the header each and every time when I add a new blog page. <div id="header" class="headertop " > <nav></nav> </div> Is there a way where i can add the class when the url passes blog/ ? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2W1qFR6 via IFTTT

Laravel 5.4 with Pusher Illuminate\Broadcasting\BroadcastException' with message '404 NOT FOUND

I'm attempting to get Pusher working with Laravel 5.4, but I keep running into the push failing in the queue. I've tested the Channel from the Pusher debug console and it works without issue. I can also see the browser listening on the chosen channel. I've followed the setup on the Pusher getting started page. I've used artisan to clear config and cache, done a httpd restart as well to be sure. I don't know if I am missing a step, or something else. I've seen this question asked a few times on here, but each solution which I've encorporated below, doesn't resolve the issue. Hoping someone can come up with a suggestion. Thanks in advance. Setup .env (Setup, and checked is working correctly): APP_URL=***** DB_HOST=***** BROADCAST_DRIVER=pusher PUSHER_APP_ID=****** PUSHER_APP_KEY=******************* PUSHER_APP_SECRET=*********************** broadcasting.php (Added CURL options, no success): 'pusher' => [ 'driver' => '...

I made a mistake while typing migrate:fresh does it have a way to recover deleted data

i made a big mistake guys. i run php artisan migrate:fresh on the production server. please guys, does it have a way to recover deleted data (users etc.) from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35qoU3j via IFTTT

Mail Sending in Laravel from Live Server

I did this configuration to send mail from Laravel Project.But not able to send mail getting this error. "Connection could not be established with host smtp.gmail.com [Network is unreachable #101]" .env configuration MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=test@gmail.com MAIL_PASSWORD=******** MAIL_ENCRYPTION=tls from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Sw4Y9R via IFTTT

Laravel: Validation keeps failing for array of images uploaded by Vue

I have an array of files being uploaded by the Vue frontend. I am trying to validate them before they are uploaded and if they failed the Validator, return the error as json for the frontend. However, even when I upload a valid image, I get the error The image field is required . When I checked the network request in Chrome, the Headers show file[]: binary and when I click 'view source' under the headers, it shows: ------WebKitFormBoundaryu3sdahHmJlPW Content-Disposition: form-data; name="file[]"; filename="logo.png" Content-Type: image/png . I am not sure what I am doing wrong. * Controller * public function uploader(Request $request) { $validator = \Validator::make($request->all(), [ 'image' => 'required', 'image.*' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]); if ($validator->fails()) { return response()->json([ 'statu...

Vue / Laravel: How to validate files uploaded from the frontend?

I have an image uploader on my Vue app that takes multiple files. I want to ensure they are images and of a certain size and if not, obviously don't upload the files and have the frontend display the error. Right now, the route it hits in the controller loos like this: public function uploadAssets(UploadAssetsFormRequest $request) { if ($request->hasFile('file')) { $files = $request->file('file'); $stack = []; foreach ($files as $file) { $fileName = Storage::put('/check/', file_get_contents($file->getRealPath()), ['visibility' => 'public']); array_push($stack, $fileName); } return response()->json($stack); } } My Form Request is below and has the validation but I don't know how to apply that in the controller. UploadAssetsFormRequest <?php namespace App\Http\Requests\Admin; use Illuminate\Foundation\Http...

Laravel Passport JWT authentication failing

Out of the blue I started getting this error in production when trying to create a JWT through passport, running on Ubuntu/apache2. As far as I'm aware nothing was changed on the server, no installs, no deployments, it just stopped working. production.ERROR: There was an error while creating the signature: error:04066044:rsa routines:rsa_ossl_private_encrypt:internal error {"exception":"[object] (InvalidArgumentException(code: 0): There was an error while creating the signature: error:04066044:rsa routines:rsa_ossl_private_encrypt:internal error at /api/vendor/lcobucci/jwt/src/Signer/OpenSSL.php:27) [stacktrace] #0 /api/vendor/lcobucci/jwt/src/Signer/BaseSigner.php(36): Lcobucci\\JWT\\Signer\\OpenSSL->createHash('eyJ0eXAiOiJKV1Q...', Object(Lcobucci\\JWT\\Signer\\Key)) #1 /api/vendor/lcobucci/jwt/src/Builder.php(470): Lcobucci\\JWT\\Signer\\BaseSigner->sign('eyJ0eXAiOiJKV1Q...', Object(Lcobucci\\JWT\\Signer\\Key)) #2 /api/vendor/lcobucci/jwt/src...

Ajax call on change not working in laravel 5.8

web.php file Route::group(['middleware'=>['auth','lfwuser']], function(){ Route::get('/lfwuser_addEngagementData', 'LfwUser\LfwDashboardController@getEngagementData'); Route::post('/lfwuser_SubDataEngagementData', 'LfwUser\LfwDashboardController@fetchSubData'); }); LfwDashboardController File. public function getEngagementData(){ if (Auth::check()) { $data = DB::table('table') ->select('col') ->distinct('col') ->get(); return view('lfwuser.lfwuser_addEngagementData')->with('data', $data); } else { return \view('auth.login'); } } public function fetchSubData(Request $request){ if (Auth::check()) { echo "Hello World"; } else { return \view('auth...

Route redirection is not working in Laravel

After successfully login in my Laravel application, it takes me to dashbaord. After logout from the application it takes me to the login page again. But if I click back icon from the browser It will take me to dashboard again though I have log out . routes Route::get('/admin-login', 'userController@index'); Route::post('/admin-login', 'userController@admin_login'); Route::get('/admin-logout', 'userController@admin_logout'); Route::get('/dashboard', 'dashboardController@index'); dashboardController.php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class dashboardController extends Controller { public function __construct() { if (!Auth::check()) { return redirect('/admin-login'); //This Redirection Doesn't Work } } public function index() { return view('admin.dashboard.dashboard'); } } Where is ...

Ajax not calling in Laravel 5.8

Web.php file Route::group(['middleware'=>['auth','admin']], function(){ Route::get('/admin_addEngagementData', 'Admin\DashboardController@getEngagementForm'); Route::post('/admin_insertEngagementData', 'Admin\DashboardController@insertEngagementData'); }); admin_addEngagement.blade.php @extends('layouts.admin') @section('title') LeapForWord | Content Management @endsection @section('content') <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header card-header-primary"> <center> <h4 class="card-title">Add DataTypes</h4> </center> </div> <div class="card-body"> <div class="table-responsive"> <form me...

Trying to get property 'posting_date' of non-object (View: C:\xampp\htdocs\ecampus\resources\views\classdetail.blade.php)

ErrorException (E_ERROR) Trying to get property 'posting_date' of non-object (View: C:\xampp\htdocs\ecampus\resources\views\classdetail.blade.php) Previous exceptions Trying to get property 'posting_date' of non-object (0) <thead> <tr> <th scope="col">Sl</th> <th scope="col" style="width: 20%">Publish date</th> <th scope="col">Subject</th> <th scope="col">Message</th> <th scope="col">Message</th> </tr> </thead> <tbody> <tr> <td scope="row"> @php echo $i++ ; @endphp </td> <td></td> <td></td> <td></td> <td> from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2WnDfZY via IFTTT

laravel 5.2 pass variable in all controllers

can someone help please, i want to make my varaibles global in all controllers without every time create instance.. settings = new Setting(); settings has only one row. class Controller extends BaseController protected $settings; public function __construct() { $this->settings = Setting::all(); View::share('settings', $this->settings); } } and in another controller i use : $this->settings->email; but it does not work, please i search and see this method is not good, can someone please give me a good approach for this, laravel 5.2. thanks so much..!! from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2VSEAsU via IFTTT

Laravel 7 HTTP Client - Unable to send POST request with `body`

Using Laravel 7.6 and it's built-in HTTP Client. I'm trying to send a simple POST request with body in Raw JSON format to my other domain but no luck: $response = Http::post('https://example.com', [ 'body' => '{ test: 1 }' ]); I get 400 Bad Request - Client error - because my server expects body as a mandatory. What am I missing here? from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3d3KBbZ via IFTTT

Laravel app logging out authenticated user when redirecting (it shouldn't)

I have created a method that logs a user into our site via a link from a separate website. We use a token and username to find the user, then use the built in login method to authenticate them (I can confirm this all works as expected). Here is the function: public function login($username, $token, $redirect) { $accountLogin = AccountLogin::Where('username', $username) ->Where('token', $token) ->first(); if ($accountLogin) { try { Auth::login($accountLogin); print_r(Auth::check()) // prints 1. header('Location: ' . $redirect); exit; } catch (\Exception $e) { return $e->getMessage(); } } echo(array( 'status' => 'error', 'message' => 'Error logging in' )); } My problem is that the user seems to be logged out after the redirect. Within the function above I can see the the account is foun...

Changing the index blade in laravel issue

I have following in my laravel web.php Route::get('/', function () { return view('home'); })->middleware('auth'); Route::get('/home', 'HomeController@index'); This would redirect my users back to login page if they are not logged in and logged in users would redirect to home page. Now In my home controller index function I have following code, public function index() { $get_customers = User::where('user_roles','=','customer')->get(); $count_customers = $get_customers->count(); $get_apps = Website::all(); $count_apps = $get_apps->count(); return view('home',compact('count_customers','count_apps')); } When every time i'm trying to access my home page after logged in i'm getting an error saying $count_apps is undefined BUT, When I used following routing in my web.php instead of previous routing, home page gives no erro...

how to show user name with id from 2 tables in laravel

when i send a letter, i catch sender_id with auth()->user()->id and save into the letter table but just user_id will save, like 2 or 3 ... how can i show user name in my view ? list.blade.php : <tr> <td></td> </tr> LetterController.php -> public function index : $letters = Letter::latest()->paginate(10)->where('recieve_id', '=', auth()->user()->id); LetterController.php -> public function store : Letter::create([ 'sender_id' => auth()->user()->id, ]); letter table : $table->string('sender_id'); and i have a relation but i dont know it is correct or not Letter.php : public function user() { return $this->belongsTo(User::class, 'id', 'sender_id'); } User.php: public function letter() { return $this->hasMany(Letter::class); } UPDATE : in veiw when use this : <td></td> but i have this error : SQLSTATE[42S22]: Column not found: 1054 Unknown column ...

distinct() on specific column is not working in laravel?

I am trying to get rows where rate_card_id is different but is not working. $distinct_rows = RateCharge::where('customer_charge_id',$customer_charge_id)->distinct('rate_card_id')->get(); it is fetching all the rows where customer_charge_id matched. from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3c6agRn via IFTTT

is there any rewrite rule to map laravel's /public/ directory with its prevoius directory?

I am refering few website for references, https://laracasts.com/discuss/channels/laravel/wordpress-and-laravel-on-subfolder?page=1 htaccess to allow laravel site inside of wordpress Basically, I have placed a laravel directory inside a wordpress. https://exmapledomain.com -> Wordpress Directory https://exampledomain.com/demo -> laravel directory the folder structure is like this /var/www/html/exampledomain/web : Wordpres /var/www/html/exampledomain/web/demo : laravel from different refrences, i have placed a .httaccess file inside demo(laravel ) cat /var/www/html/exampledomain/web/demo/.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} !^public RewriteRule ^(.*)$ public/$1 [L] </IfModule> now when i type : https://exampledomian.com/demo , it gives me 404 ( this 404 comes from laravel because its cant go to public, but if i type https://exampledomain.com/demo/public , it works fine from Newest questions tagged laravel-5 - Stack Overflow...

Send email verification code to another base_url in laravel

I have two laravel systems and both connected to one master database 1.customer portal-customer.test 2.admin portal - admin.test Customers are not allowed to access to the admin portal But admin can create customers from admin dashboard. Customers cannot' login to their profile until they verify their email. Currently if an user creates an account directly through the customer portal, the user receive the verification email and if he/she clicks on the link with in 60 minutes, account get verified and activated. verification link look like this: http://customer.test/email/verify/13/976bdd188ad675ad87c827ca9723fb4a7bda2178?expires=1588242534&signature=cc628ef025eb7cd03fe76093be1e9e3fdfce12f5208c185560d1996b9f662744 But now when the admin creates an user account for a customer through the admin panel(admin.test)same process need to be happened. Following is my user create function in the controller public function store(Request $request) { request()->validate([ ...