Category : database

I am new to Laravel. I am trying to insert some data into the table of the database at a particular time, say 12 am. What I have tried is: QuoteController.php use IlluminateHttpRequest; use AnomalyStreamsPlatformHttpControllerResourceController; use GuzzleHttpClient; use AppRating; use DB; //use IlluminateSupportFacadesDB; class QuoteController extends ResourceController { public function sendMessage(Request $request) { //dd($request->all()); $current_date ..

Read more

// how should i join these 4 tables users, pages, category, products using relationships intead in controller. //I also prefer calling these functions from corresponding models using respective function names but not database column names in view. Thanks in advance. These are my models //models class User extends Authenticatable{ use HasFactory, Notifiable; protected $fillable = ..

Read more

I’m trying to save multiple Label Text of Checkboxes. First, I’m saving chechbox value in a column of database table. But other than that, I have to save Label of each those checkbox checked in another column of table. My table: Schema::create(‘restaurant_offers’, function (Blueprint $table) { $table->increments(‘id’); ……. $table->string(‘additionalOptions’)->nullable(); $table->string(‘additionalOptionsSum’)->nullable(); …… }); My blade: <label ..

Read more

I’m using Laravel but I’m trying to make paypal integration with php codes, I have created the Paypal Checkout SDK V1.0.1 by compiling : composer require paypal/paypal-checkout-sdk 1.0.1 so here is my PaypalTransaction.php(inside the SDK folder): <?php namespace Sample; require __DIR__ . ‘/vendor/autoload.php’; //1. Import the PayPal SDK client that was created in `Set up ..

Read more

i have taken the id and mobile_num from users table.i have to insert that id name in this table as user_id,mobile_num,and status(0,1) into another table(wc_sms_status).sendSMSFunction is working fine. public function SendBulkSms() { $usersNumber = User::select(‘id’,’mobile_num’)->whereIn(‘id’, [5,6,7,8])->get(); foreach($usersNumber as $userNumber) { if (!$userNumber->mobile_num) { $this->sendSmsFunction($userNumber->mobile_num); DB::table(‘wc_sms_status’)->insert([ [‘user_id’ => ‘id’], [‘mobile_num’ => ‘mobile_num’] // set the status=1 ..

Read more

I’m Using this code to click on Buttons to access their informations without loading the page, But Therefore I can’t receive the Database datas, <div class="itemss"> <span id="span-TEST1" class="item" data-name="TEST1" onclick="btnClick(this)">TEST1</span> <span id="span-TEST2" class="item" data-name="TEST2" onclick="btnClick(this)">TEST2</span> <span id="span-TEST3" class="item" data-name="TEST3" onclick="btnClick(this)">TEST3</span> <span id="span-TEST4" class="item" data-name="TEST4" onclick="btnClick(this)">TEST4</span> <span id="span-TEST5" class="item" data-name="TEST5" onclick="btnClick(this)">TEST5</span> <span id="span-TEST6" class="item" data-name="TEST6" ..

Read more

I am currently doing a local project, using MAMP with PHP version 7.4.21 and I can’t seem to run my system because the database is not configured correctly. Here’s my .env APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost:8888/VMLM LOG_CHANNEL=stack LOG_LEVEL=debug DB_CONNECTION=vmlm DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD= and here’s my database.php connections’ => [ ‘sqlite’ => [ ‘driver’ ..

Read more

I’m intending to delete a Category in my database , I have succeeded doing that by using Livewire Components but im trying to make it with using Controllers. This is my Controller.php: <?php namespace AppHttpControllers; use IlluminateHttpRequest; use Brian2694ToastrFacadesToastr; use AppModelsStaff; use AppModelsUser; use AppModelsCategory; use LivewireWithPagination; use HaruncpiLaravelIdGeneratorIdGenerator; use DB; class CategoriesController extends Controller ..

Read more

I get this error Undefined variable $image (View: C:xampphtdocsLaravelresourcesviewsformformadd.blade.php) , $image is undefined. The variable is not declared but I have declared $image inside my controller. This is my Controller that Im using: FormController.php: <?php namespace AppHttpControllers; use IlluminateHttpRequest; use Brian2694ToastrFacadesToastr; use AppModelsStaff; use AppModelsUser; use AppModelsProduct; use AppModelsCategory; use IlluminateSupportStr; use CarbonCarbon; use LivewireWithFileUploads; ..

Read more

For Attribute i can make two table 1 is attributes and another is attribute_values For attributes table Schema::create(‘attributes’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->string(‘attributeName’)->unique(); $table->timestamps(); }); For attribute_values table Schema::create(‘attribute_values’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->unsignedBigInteger(‘attributeId’); $table->string(‘value’)->unique(); $table->timestamps(); }); I want to show like: Under Size: L, S, M, XL etc Under Color: Red, Green ..

Read more