mstdmstd

Experience

2,000

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

21st November, 2017

mstdmstd started a new conversation How To Use Eloquent Event? • 16 hours ago

Hello,

I laravel 5.5 I want to update some fields apart from my control, I need to use Eloquent events for that, so In my model:


<?php
namespace App;

use App\Events\TmpCsvpUpdating;

class TmpCsvp extends Model
{
    protected $table = 'tmp_csvps';
    protected $primaryKey = 'id';

    protected $dispatchesEvents = [
        'updating' => TmpCsvpUpdating::class,
    ];
...

I run command :

php artisan make:event TmpCsvpUpdating 

and I get a file :

<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class TmpCsvpUpdating
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}

But I did not how to reference my updating object and how to update it?

Thanks!

15th November, 2017

mstdmstd left a reply on Tables Export Into To Csv Files • 6 days ago

I still search for decision to upload several csv files to my disk.

  1. If there is some way to make kind of buffering ( like ob_start ) of output data and write them to the files manually?

  2. If there is some other toll that could do this?

mstdmstd left a reply on Tables Export Into To Csv Files • 6 days ago

With methods mentions above generated csv file is uploaded through browsers. If there is a way just to write this csv file to disk without uploading?

mstdmstd left a reply on Tables Export Into To Csv Files • 6 days ago

Thanks for you help! But one more(I hope last) question: I upload 1 file ok, but as I need to upload several tables any to the reletive file I run the exporting function in a circle and only the first file is uploaded. Is it restriction of the browser(I tried in chromium, firefox) or if is the way to upload all files?

mstdmstd left a reply on Tables Export Into To Csv Files • 6 days ago

Thank you, I tried to make your way but got error https://imgur.com/a/jqmwe How to fix it ?

mstdmstd left a reply on Tables Export Into To Csv Files • 6 days ago

Thank you for the feedback. I made a wrapper function like:

    public static function writeArrayToCsvFile(array $dataArray) : int
    {
        $filename= '/_wwwroot/lar/csvp/public/uploads/csv/res.csv';
        $_SESSION['dataArray']= $dataArray;
        Excel::create($filename, function($excel) {

            $excel->sheet('file', function($sheet) {
//                global  $dataArray;
                $sheet->fromArray( $_SESSION['dataArray'] );
            });

        })->export('csv');
        return 1;
    }

it works, but

  1. How to set $dataArray parameter inside of
            $excel->sheet(

block, as inside this block $dataArray parameter is not accessible and global does not work in php7 ? I used session variable, but I do not think that is the best way.

  1. I set to $filename variable full path I expected the resulting file would be saved, but the file was downloaded as /home/serge/Downloads/-_wwwroot-lar-csvp-public-uploads-csv-res.csv.csv I did not find right options...

14th November, 2017

mstdmstd started a new conversation Tables Export Into To Csv Files • 1 week ago

Hello, I want some my tables export into to csv files and I get this http://www.maatwebsite.nl/laravel-excel/docs/export#export library

and I see :

Excel::create('Filename', function($excel) {

})->export('xls');

But what I missed is how to set list of headers and data array itself? Has it some useful options?

Thanks!

11th November, 2017

mstdmstd started a new conversation Laravel 5.5 Migrations With Postgres Questions • 1 week ago

Hello,

Working with Laravel 5.5 Migrations with Postgres :

  1. If I define several tables I got error:

$ php artisan migrate

  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "doc_type_id" referenced in foreign key constraint does not exist (SQL: alter table "cs_docs" add constraint "docs_doc_type_id_foreign" foreign key ("doc  
  _type_id") references "cs_doc_types" ("id") on delete RESTRICT)  

for table definition in 2017_11_11_114839_create_docs_table.php file:

            $table->bigIncrements('id');

            $table->foreign('doc_type_id')->references('id')->on('doc_types')->onDelete('RESTRICT');

as 'doc_types' table is defined in other file and looks like that I need to run migrate for 'doc_types' table at first. Is there is a way to set such ordering? I missed it? I think I can to write all tables definitions in 1 file, but is this a good way?

  1. Defining field as :

I see in generated table next:

        CONSTRAINT cs_tmp_csvps_is_applied_check CHECK (((is_applied)::text = ANY ((ARRAY['Y'::character varying, 'N'::character varying])::text[]))),

actually I would like to get next Postgres structure

    'P',
    'M',
    'H'
);
...
    content_type type_cms_item_content_type NOT NULL DEFAULT 'P'::type_cms_item_content_type,
  1. Defining field as :

I have 2 fields created created_at and updated_at . As I need to create only created_at I could write :

But is there is a way to set default time on server, like : ```created_at timestamp NOT NULL DEFAULT now(),


Thanks!

7th November, 2017

mstdmstd left a reply on How Start Working With Amazon S3 Cloud • 2 weeks ago

I am not sure... Creating new user I checked "Programmatic access" option and left “AWS Management Console access” option unchecked

Describing the Policy I wrote :

"Resource": [
                "arn:aws:s3:::nsnmed"
            ]
        },

Of my bucket.

I did not find where to specify where user has permissions to access my bucket ? Please, clarify?

6th November, 2017

mstdmstd left a reply on How Start Working With Amazon S3 Cloud • 2 weeks ago

It still does not work for me... I created new Access keys with new secret key and inserted these parameters, but the same error! Any ideas?

mstdmstd left a reply on How Start Working With Amazon S3 Cloud • 2 weeks ago

Thanks for the link! I also searched more and found this https://wogan.blog/2017/01/04/use-amazon-s3-with-laravel-5/ description. According to it I created IAM User, Group and Policy and attached my IAM User to the Group and Policy. But but uploading my file I got error :

S3Exception in WrappedHttpHandler.php line 192:
Error executing "PutObject" on "https://nsnmed.s3-us-west-2.amazonaws.com/uploads/OperationFile/24/1509953227-1.pdf"; AWS HTTP error: Client error: `PUT https://nsnmed.s3-us-west-2.amazonaws.com/uploads/OperationFile/24/1509953227-1.pdf` resulted in a `403 Forbidden` response:
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>F59F73 (truncated...)
AccessDenied (client): Access Denied - <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>F59F7304DABAE9F7</RequestId><HostId>hFPo7S53x3DpmnndlKNe7hR5r1raq+qKn4asoNNVTOdGwS7KlQ0RmyVRE8LCYUOGedJjNRZuiOk=</HostId></Error>
in WrappedHttpHandler.php line 192
at WrappedHttpHandler->parseError(array('exception' => object(ClientException), 'connection_error' => false, 'response' => object(Response)), object(Request), object(Command), array()) in WrappedHttpHandler.php line 97
at WrappedHttpHandler->Aws\{closure}(array('exception' => object(ClientException), 'connection_error' => false, 'response' => object(Response))) in Promise.php line 203
at Promise::callHandler('2', array('exception' => object(ClientException), 'connection_error' => false, 'response' => object(Response)), array(object(Promise), object(Closure), object(Closure))) in Promise.php line 174
at Promise::GuzzleHttp\Promise\{closure}(array('exception' => object(ClientException), 'connection_error' => false, 'response' => object(Response))) in RejectedPromise.php line 40
at RejectedPromise::GuzzleHttp\Promise\{closure}() in TaskQueue.php line 47
at TaskQueue->run() in CurlMultiHandler.php line 96
at CurlMultiHandler->tick() in CurlMultiHandler.php line 123
at CurlMultiHandler->execute(true) in Promise.php line 246
at Promise->invokeWaitFn() in Promise.php line 223
at Promise->waitIfPending() in Promise.php line 267
at Promise->invokeWaitList() in Promise.php line 225
at Promise->waitIfPending() in Promise.php line 267
at Promise->invokeWaitList() in Promise.php line 225
at Promise->waitIfPending() in Promise.php line 62
at Promise->wait() in S3ClientTrait.php line 33
at S3Client->upload('nsnmed', 'uploads/OperationFile/24/1509953227-1.pdf', '%PDF-1.3 %���� 194 0 obj << /Linearized 1 /L 1257876 /H [ 993 279 ] /O 197 /E 263192 /N 33 /T 1253877 >> endobj xref 194 11 0000000016 00000 n 0000000598 00000 n 0000000655 00000 n 0000001272 00000 n 0000001411 00000 n 0000001512 00000 n 0000001684 00000 n 00000017

Several printscreens from my aws s3 creditials:

https://imgur.com/a/9UGO2 http://i.piccy.info/i9/2ad57860552544212f6dac64203b861a/1509953635/50972/1194037/1.png https://imgur.com/a/oZyWN https://imgur.com/a/bKq0Y

Full content of the policy :

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:ListAllMyBuckets",
                "s3:GetBucketLocation"
            ],
            "Resource": [
                "arn:aws:s3:::nsnmed"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::nsnmed/*"
            ]
        }
    ]
}

and https://imgur.com/a/xafqH

Could you please give me a hint which option did I miss ?

5th November, 2017

mstdmstd left a reply on How Start Working With Amazon S3 Cloud • 2 weeks ago

Sorry, I still search how to get key and secret key under my bucket properties ? If you worked with amazon s3 bucket could you please to share(maybe with printscreen) how to get key and secret key under of the bucket ?

3rd November, 2017

mstdmstd left a reply on How Start Working With Amazon S3 Cloud • 2 weeks ago

Thanks for your help!

I have free AWS account and I created new s3 bucket : https://imgur.com/a/fXdDY

As I see in config/filesystems.php file must be filled next parameters:

          'key'     => env('S3_KEY'),
          'secret'  => env('S3_SECRET'),
          'region'  => env('S3_REGION'),
          'bucket'  => env('S3_BUCKET'),

I see how fill paramemeter S3_BUCKET = "nsnmed" - name of my bucket. I did not find where to read parameters S3_KEY and S3_SECRET ? Which value must be entered for S3_REGION = "US West(Oregon)" ?

2nd November, 2017

mstdmstd started a new conversation How Start Working With Amazon S3 Cloud • 2 weeks ago

Hi, I existing laravel 5 application I found code for images uploading on amazon s3 cloud:

use Storage;
...
$s3 = Storage::disk('s3');
$uploaded = $s3->put($upload_path, file_get_contents($this->file), 'public');

Is this implementation of this API: https://aws.amazon.com/sdk-for-php/ ?

is it some extention ?

Could you please give ref how to get free API keys for AWS s3 and start working with it?

Thanks!

1st November, 2017

mstdmstd started a new conversation Compile Sass In Laravel 5.2.45 Project • 2 weeks ago

Hello, I launch locally the project Laravel 5.2.45 and I get a bunch of errors of the form file like /assets/css/app.css not found Running the command (in the Linux console) I get an access error

$ sass --watch resources / assets / sass / app.scss: /assets/css/app.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
Errno :: EACCES: Permission denied @ rb_sysopen - /assets/css/app.css
  Use --trace for backtrace.

In my linux console I performed as root:

 sudo chmod -R 777 / project_path /

Does not help...

If you execute under the root and make changes, I get:

root @ serge-at-home: / project_path / # sudo chmod -R 777 / _wwwroot / project_path /
root @ serge-at-home: / project_path / #sass --watch resources / assets / sass / app.scss: /assets/css/app.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
      write /assets/css/app.css
      write /assets/css/app.css.map
>>> Change detected to: resources / assets / sass / app.scss
      write /assets/css/app.css
      write /assets/css/app.css.map
>>> Change detected to: resources / assets / sass / app.scss
      write /assets/css/app.css
      write /assets/css/app.css.map

At the same time, the files app.css and app.css.map neither in / public / assets / css / found in other subdirectories ...

In resources/assets/sass/app.scss file there are 55 definitions of the form:

@import "filename";
...

 I found the file gulpfile.js:

 var gulp = require ('gulp');
var sass = require ('gulp-sass');
var minifycss = require ('gulp-minify-css');
var uglify = require ('gulp-uglify');

gulp.task ('sass', function () {
    gulp.src (['resources / assets / sass / app.scss'])
    .pipe (sass ({
        outputStyle: 'expanded'
    }))
    .pipe (minifycss ())
    .pipe (gulp.dest ('public / assets / css /'));
});

gulp.task ('scripts', function () {
    gulp.src (['resources / assets / vendor / ** / *']). pipe (gulp.dest ('public / assets'));
    gulp.src (['resources / assets / js / ** / *']) pipe (uglify ()). pipe (gulp.dest ('public / assets / js'));
})

What can be the problem of how to properly generate media files in the Laravel 5.2 project?

Thank you!

27th October, 2017

mstdmstd left a reply on Rest Api With Register/activation/login Functionality Samples • 3 weeks ago

Thanks for responce! After Auth scaffolding command I did not find routes generated. Have they be generated ? I see fileapp/Http/Controllers/Auth/RegisterController.php with validator/create methods.

Have I to add to routes/api.php file line like:

        Route::post('register','Auth/[email protected]'); 

?

26th October, 2017

mstdmstd started a new conversation Rest Api With Register/activation/login Functionality Samples • 3 weeks ago

Hi all, I need with laravel 5.5/mysql to make Rest api with clients/goods and I need register/activation/login functionality implemented. It seems somewhat tricky... Could you please give reference to good sample implementation(page or video).

Thanks!

23rd October, 2017

mstdmstd left a reply on Logining In Laravel5.5 App With Account Of Facebook, Twitter... • 4 weeks ago

As far as I know that is possible from php application to sent new post in facebook or in twitter...

mstdmstd started a new conversation Logining In Laravel5.5 App With Account Of Facebook, Twitter... • 4 weeks ago

Hello,

Could you please advice some extention/library for logining in laravel5.5 app with account of facebook, twitter, etc...

If this library would have some additive functionality(lik sending messages) that would be very nice...

Thanks!

22nd October, 2017

mstdmstd left a reply on 1 Routes Rule For 4 Urls • 4 weeks ago

Thank you, But in this case urls for editor are triggered by this route, like

/admin/category/edit?id=7&page=1

I tried to exclude “edit” from this route, like :

Route::get('/admin/category/{name?}', 'Admin\[email protected]')->where('name','[index|list|!edit]+');

But failed.Which is the right way ?

21st October, 2017

mstdmstd started a new conversation 1 Routes Rule For 4 Urls • 1 month ago

Hello, In laravel 5.5 I want to write 1 routes rule to make all next urls:

http://host.com/admin/category/list
http://host.com/admin/category/index
http://host.com/admin/category/
http://host.com/admin/category

to work for 1 control action.

I tried to write in routes :

Route::get('/admin/category/{name}', 'Admin\[email protected]')->where('name','[\/|index|list]+');

But only 2 first urls works ok, but the last 2 urls do not work. Which is the correct way ?

Thanks!

15th October, 2017

mstdmstd left a reply on To See Laravel Mix Succesfull Message • 1 month ago

It is not OS dependable feature? It will work only on Mac, but not on my MSI Laptop GP70 2PE Leopard?

14th October, 2017

mstdmstd started a new conversation To See Laravel Mix Succesfull Message • 1 month ago

Hello! Viewing some lessons on youtube I see, when author modifies some scss/js files laravel mix succesfull message on the screen at right top corner. Can I do similar with laravel 5 on my Kubuntu 16 and how?

Thanks!

10th October, 2017

mstdmstd left a reply on Possibility To Send In Email My Html Code • 1 month ago

Thanks!, that was helpful. And one more questions : I the docs page above there is next:

/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    'Illuminate\Mail\Events\MessageSending' => [
        'App\Listeners\LogSentMessage',
    ],
];

But Adding this line to my app/Providers/EventServiceProvider.php file I got error :

ERROR: Class App\Listeners\LogSentMessage does not exist 

Looks like I need to create this class? Coulld you give please (link to) example how to implement this ?

Thanks!

9th October, 2017

mstdmstd started a new conversation Possibility To Send In Email My Html Code • 1 month ago

Hello! Reading this doc https://laravel.com/docs/5.5/mail I search possibility to send in email my html, which is based on HTML/Markdown content, but not a file from resources/views/emails subdirectory.

I tried to use Mail::raw method with wrapper function, like:
    public function sendEmail($to, $email_title, $email_content)
   {   

        Mail::raw($email_content, function ($message) {
            $message->from('[email protected]', 'Laravel');
            $message->to( $to )->cc('[email protected]');
            $message->subject($email_title);
        });

But I got error that $to variable not found. How with such wrapper file to send my $to parameter and if is way is correct?

In my case html of email are based on bd content in HTML format.

Thanks!

8th October, 2017

mstdmstd started a new conversation Error Installing Vue-resourc • 1 month ago

Hello, I try to install new project with installing vue-resource, laravel-elixir-vue-2 But running commands I got errors/warnings :

── UNMET PEER DEPENDENCY [email protected]^3.4.2 || ^4.0.0

and

npm WARN laravel-elixir-vue-2@0.3.0 requires a peer of [email protected]^2.1.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^3.4.2 || ^4.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^2 || ^2.2.0-rc.0 || ^2.1.0-beta || ^1.12.6 but none was installed.

I put all output below. What is the problem and how to fix it ?

[email protected]:/_wwwroot/lar$ export PATH="$PATH:~/.composer/vendor/bin"
[email protected]:/_wwwroot/lar$ laravel new cprods
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing doctrine/inflector (v1.2.0)
    Loading from cache

  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing erusev/parsedown (1.6.3)
    Loading from cache

  - Installing vlucas/phpdotenv (v2.4.0)
    Loading from cache

  - Installing symfony/css-selector (v3.3.10)
    Loading from cache

  - Installing tijsverkoyen/css-to-inline-styles (2.2.0)
    Loading from cache

  - Installing symfony/polyfill-mbstring (v1.5.0)
    Loading from cache

  - Installing symfony/var-dumper (v3.3.10)
    Loading from cache

  - Installing symfony/routing (v3.3.10)
    Loading from cache

  - Installing symfony/process (v3.3.10)
    Loading from cache

  - Installing symfony/http-foundation (v3.3.10)
    Loading from cache

  - Installing symfony/event-dispatcher (v3.3.10)
    Loading from cache

  - Installing psr/log (1.0.2)
    Loading from cache

  - Installing symfony/debug (v3.3.10)
    Loading from cache

  - Installing symfony/http-kernel (v3.3.10)
    Loading from cache

  - Installing symfony/finder (v3.3.10)
    Loading from cache

  - Installing symfony/console (v3.3.10)
    Loading from cache

  - Installing egulias/email-validator (2.1.2)
    Loading from cache

  - Installing swiftmailer/swiftmailer (v6.0.2)
    Loading from cache

  - Installing paragonie/random_compat (v2.0.11)
    Loading from cache

  - Installing ramsey/uuid (3.7.1)
    Loading from cache

  - Installing psr/simple-cache (1.0.0)
    Loading from cache

  - Installing psr/container (1.0.0)
    Loading from cache

  - Installing symfony/translation (v3.3.10)
    Loading from cache

  - Installing nesbot/carbon (1.22.1)
    Loading from cache

  - Installing mtdowling/cron-expression (v1.2.0)
    Loading from cache

  - Installing monolog/monolog (1.23.0)
    Loading from cache

  - Installing league/flysystem (1.0.41)
    Loading from cache

  - Installing laravel/framework (v5.5.14)
    Loading from cache

  - Installing fideloper/proxy (3.3.4)
    Loading from cache

  - Installing jakub-onderka/php-console-color (0.1)
    Loading from cache

  - Installing nikic/php-parser (v3.1.1)
    Loading from cache

  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Loading from cache

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Loading from cache

  - Installing psy/psysh (v0.8.11)
    Loading from cache

  - Installing laravel/tinker (v1.0.2)
    Loading from cache

  - Installing filp/whoops (2.1.10)
    Loading from cache

  - Installing fzaninotto/faker (v1.7.1)
    Loading from cache

  - Installing hamcrest/hamcrest-php (v1.2.2)
    Loading from cache

  - Installing mockery/mockery (0.9.9)
    Loading from cache

  - Installing webmozart/assert (1.2.0)
    Loading from cache

  - Installing phpdocumentor/reflection-common (1.0.1)
    Loading from cache

  - Installing phpdocumentor/type-resolver (0.4.0)
    Loading from cache

  - Installing phpdocumentor/reflection-docblock (4.1.1)
    Loading from cache

  - Installing phpunit/php-token-stream (2.0.1)
    Loading from cache

  - Installing sebastian/version (2.0.1)
    Loading from cache

  - Installing sebastian/resource-operations (1.0.0)
    Loading from cache

  - Installing sebastian/recursion-context (3.0.0)
    Loading from cache

  - Installing sebastian/object-reflector (1.1.1)
    Loading from cache

  - Installing sebastian/object-enumerator (3.0.3)
    Loading from cache

  - Installing sebastian/global-state (2.0.0)
    Loading from cache

  - Installing sebastian/exporter (3.1.0)
    Loading from cache

  - Installing sebastian/environment (3.1.0)
    Loading from cache

  - Installing sebastian/diff (2.0.1)
    Loading from cache

  - Installing sebastian/comparator (2.0.2)
    Loading from cache

  - Installing phpunit/php-text-template (1.2.1)
    Loading from cache

  - Installing doctrine/instantiator (1.0.5)
    Loading from cache

  - Installing phpunit/phpunit-mock-objects (4.0.4)
    Loading from cache

  - Installing phpunit/php-timer (1.0.9)
    Loading from cache

  - Installing phpunit/php-file-iterator (1.4.2)
    Loading from cache

  - Installing theseer/tokenizer (1.1.0)
    Loading from cache

  - Installing sebastian/code-unit-reverse-lookup (1.0.1)
    Loading from cache

  - Installing phpunit/php-code-coverage (5.2.2)
    Loading from cache

  - Installing phpspec/prophecy (v1.7.2)
    Loading from cache

  - Installing phar-io/version (1.0.1)
    Loading from cache

  - Installing phar-io/manifest (1.0.1)
    Loading from cache

  - Installing myclabs/deep-copy (1.6.1)
    Loading from cache

  - Installing phpunit/phpunit (6.4.1)
    Loading from cache

symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/dependency-injection (For loading routes from a service)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/class-loader ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
symfony/console suggests installing symfony/filesystem ()
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
symfony/translation suggests installing symfony/config ()
symfony/translation suggests installing symfony/yaml ()
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.5).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~2.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (~3.3).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to psr7 bridging features (~1.0).)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Application ready! Build something amazing.
[email protected]:/_wwwroot/lar$ cd cprods
[email protected]:/_wwwroot/lar/cprods$ node -v
v7.10.0
[email protected]:/_wwwroot/lar/cprods$ npm -v
4.2.0
[email protected]:/_wwwroot/lar/cprods$ npm install vue-resource --save
/mnt/_work_sdb8/wwwroot/lar/cprods
└─┬ [email protected]
  └─┬ [email protected]
    ├─┬ [email protected]
    │ └── [email protected]
    ├── duplexer3@0.1.4
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├─┬ [email protected]
    │ ├─┬ [email protected]
    │ │ └── [email protected]
    │ └── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├─┬ [email protected]
    │ └── [email protected]
    ├── [email protected]
    ├── timed-[email protected]
    ├─┬ [email protected]
    │ └── [email protected]
    └── [email protected]

[email protected]:/_wwwroot/lar/cprods$ npm install  laravel-elixir-vue-2 --save-dev
/mnt/_work_sdb8/wwwroot/lar/cprods
├─┬ laravel-elixir-vue-2@0.3.0
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   ├── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├── [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├─┬ [email protected]
│ │ │ │   │ ├─┬ [email protected]
│ │ │ │   │ │ └── [email protected]
│ │ │ │   │ └── [email protected]
│ │ │ │   ├── [email protected]
│ │ │ │   └── [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── json5@0.5.1
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── js-base64@2.3.2
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├─┬ [email protected]
│ │ │   │ └── [email protected]
│ │ │   ├── [email protected]
│ │ │   └─┬ [email protected]
│ │ │     └── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── UNMET PEER DEPENDENCY [email protected]^3.4.2 || ^4.0.0
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ └── [email protected]
│ │ │ └─┬ [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── UNMET PEER DEPENDENCY [email protected]^2 || ^2.2.0-rc.0 || ^2.1.0-beta || ^1.12.6
└── [email protected]

npm WARN laravel-elixir-vue-2@0.3.0 requires a peer of [email protected]^2.1.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^3.4.2 || ^4.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected]^2 || ^2.2.0-rc.0 || ^2.1.0-beta || ^1.12.6 but none was installed.



and I tried with error:

$ npm run dev

> @ dev /mnt/_work_sdb8/wwwroot/lar/cprods
> npm run development


> @ development /mnt/_work_sdb8/wwwroot/lar/cprods
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: 1: cross-env: not found

npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "development"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/serge/.npm/_logs/2017-10-08T07_51_23_988Z-debug.log

npm ERR! Linux 4.4.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/serge/.npm/_logs/2017-10-08T07_51_24_017Z-debug.log

3rd October, 2017

mstdmstd started a new conversation Error Upgrade To 5.5.0 • 1 month ago

Hi all, By this doc https://laravel.com/docs/5.5/upgrade I try to upgrade to 5.5.0 . I filled composer.json with next :

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "barryvdh/laravel-debugbar": "^2.3",
        "chrisbjr/api-guard": "3.1.*",
        "intervention/image": "^2.3",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "wboyz/laravel-enum": "^0.2.1"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0",
        "xethron/migrations-generator": "^2.0",
        "filp/whoops" : "~2.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ],

        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]

    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}

But in command line I got error :

# composer update
    1/4:        http://packagist.org/p/provider-latest$e2da20d6dea471b94583fa48218d7d0850a2921bf60ecd5c5535e91f64b3ca34.json
    2/4:        http://packagist.org/p/provider-2017-04$73e3e8d415937ceae790d5d82f2b2e7b52afb6224e900d81547b57bcac584ba1.json
    3/4:        http://packagist.org/p/provider-2015$3437b2a18d0325f5c3f87e7cc05f9fd584a963e076a063684a30d788c88fcb01.json
    4/4:        http://packagist.org/p/provider-2017-07$c6eb425ee4ee95967e31360c7197c8e13b92c949d6c3d2b688e2393c7346f85c.json
    Finished: success: 4, skipped: 0, failure: 0, total: 4
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize

                                                                      
  [ErrorException]                                                    
  The use statement with non-compound name 'Validator' has no effect  
                                                                      
Script php artisan optimize handling the post-update-cmd event returned with an error
                      
  [RuntimeException]  
  Error Output:                            
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

and

# php artisan --version                                                                     
  [ErrorException]                                                    
  The use statement with non-compound name 'Validator' has no effect  

But in php code I see:

app()::VERSION = 5.5.13

Is it some error in my composer.json ? How to fix it?

Thanks!

mstdmstd left a reply on How To Make Alias For Routes • 1 month ago

Closure to the relevant route ? Could you please give a link to refs how to make it ?

mstdmstd left a reply on How To Make Alias For Routes • 1 month ago

Thanks a lot! Also I did not find a way how in routes make optional prefix in url ? I mean like :

Route::get('/departments[/index]', '[email protected]');

So that the same action would be called both for '/departments/index and '/departments/index/ and '/departments/ and '/departments

?

2nd October, 2017

mstdmstd left a reply on How To Make Alias For Routes • 1 month ago

Thank you for your response! I see it as next : in routes/web.php file to write like :

// get listing of departments or only 1 department by department_id parameter
Route::get('/departments/{department_id?}', '[email protected]')->where(['department_id' => '[0-9]+']);

// get listing of active departments
Route::get('/departments/only_active', '[email protected]_active');

and in the control :

public function only_active(Request $request)
{
    $request= request();
    $paramsArray= [ 'order_by'=> '-is_active,name', 'filter_name'=> '', 'filter_is_active'=> 1, 'fields'=> 'name,department_id,created_at' ];
    echo '<pre>$paramsArray::'.print_r($paramsArray,true).'</pre>';
    $request->setValues( $paramsArray ); // If and how can I do it ?
    $this->index($request);

}

 /**
 * Display a listing of the departments or only 1 department by department_id parameter.
 *
 * @return \Illuminate\Http\Response
 */
public function index(Request $request, $department_id = null)
{
    if (defined("DEBUGGING_OUTPUT") and DEBUGGING_OUTPUT) {
        echo '<pre>$_GET::' . print_r($_GET, true) . '</pre>';
        echo '<pre>$_POST::' . print_r($_POST, true) . '</pre>';
        echo '<pre>id::' . print_r($department_id, true) . '</pre>';
    }
    ...

There is no setValues method for request object, but if there is a way to send parameters I need to index action ? As in index action all functionality(including reading parameters) is done, I do not like way of make in only_active action all functionality of index action, but I want to send parameters to index action...

mstdmstd started a new conversation How To Make Alias For Routes • 1 month ago

Hi all,

Making rest api with laravel 5.5 I I want to make alias for routes like : as GET /tickets/recently_closed

for this I tried in routes/web.php file to write like :

Route::get('/departments/only_active', '[email protected]?filter_is_active=1&order_by=-is_active,name&fields=name,department_id,created_at' );

or

Route::get('/departments/only_active', '[email protected]',['filter_is_active'=>1, 'order_by'=>'-is_active,name', 'fields'=>'name,department_id,created_at' ] );

but failed. Which is the correct way?

Can it be done without modiyfing of file ?

Thanks!

30th September, 2017

mstdmstd started a new conversation To Write To Log File Transaction Commands • 1 month ago

Hi all,

In laravel 5.5 I use db listener to write sql-statements to log file, like :

if ($this->app->environment('local')) {
    \DB::listen(function($query) {
    ...

in app/Providers/AppServiceProvider.php file. It works ok, but what I do not see in logged file are commands by DB::beginTransaction(), DB::rollback(), DB::rollback(). If there is is a way to write to log file transaction commands too?

Thanks!

15th September, 2017

mstdmstd left a reply on In Laravel 5.5 Retriving Rows From Postgresql Function • 2 months ago

Sorry, code highlighting is wrong, please give a link how correctly to make it?

mstdmstd started a new conversation In Laravel 5.5 Retriving Rows From Postgresql Function • 2 months ago

Hello, In laravel 5.5 retriving rows from postgresql function using DB::select($sql)

where sql :

select pd_report_orders_sum_by_categories( p_category_list := ARRAY[102,17]::integer[], p_last_operation_date_from := '2012-09-20', p_last_operation_date_till := '2017-09-29', p_status := 'O', p_sort_categories := 'sum', p_limit := null )

for function defined as:

CREATE OR REPLACE FUNCTION public.pd_report_orders_sum_by_categories(p_category_list integer[], p_last_operation_date_from timestamp without time zone, p_last_operation_date_till timestamp without time zone, p_status type_order_status, p_sort_categories character varying DEFAULT 'by_sum_asc'::character varying, p_limit integer DEFAULT NULL::integer) RETURNS TABLE(category_name character varying, category_slug character varying, category_id smallint, sold_sum numeric, qty_sum bigint) LANGUAGE sql AS $function$

SELECT c.name as category_name,

c.slug as category_slug,

pc.category_id,

sum( oi.qty*oi.price ) AS sold_sum,

sum( oi.qty ) AS qty_sum

from pd_order_item as oi join

  pd_product_category as pc on pc.product_id = oi.product_id join

  pd_order as o on o.id = oi.order_id join

  pd_category as c on c.id = pc.category_id

WHERE ( CASE when p_category_list IS NOT NULL THEN pc.category_id = ANY (p_category_list) else true END ) AND

   ( o.last_operation_date BETWEEN coalesce(p_last_operation_date_from,pd_f_min_timestamp()) AND coalesce(p_last_operation_date_till,pd_f_max_timestamp()) ) AND

   ( CASE when p_status IS NOT NULL THEN o.status = p_status else true END )

group by pc.category_id, category_name, category_slug

ORDER BY

    CASE WHEN p_sort_categories = 'by_sum_asc' THEN

        sum( oi.qty*oi.price )

    end ASC,

    CASE WHEN p_sort_categories = 'by_sum_desc' THEN

        sum( oi.qty*oi.price )

    end DESC,

    CASE WHEN p_sort_categories = 'by_sum_category_name' THEN

        c.name

    end ASC

LIMIT p_limit ;

$function$

I got resulting rows like : Array ( [0] => stdClass Object ( [pd_report_orders_sum_by_categories] => (Music,music,4,2.43,1) )

[1] => stdClass Object
    (
        [pd_report_orders_sum_by_categories] => ("Computer Accessories",computer-accessories,1,25.75,1)
    )
    

I can all data I need but I would like to know if there is a way to get associative data in any subarray ? Sure I can write some kind of parser, but if Laravel some tools for this?

Thanks!

14th September, 2017

mstdmstd started a new conversation Api-guard Compatible With Laravel 5.5? • 2 months ago

Hi, if this packet https://github.com/chrisbjr/api-guard is compatible with laravel 5.5? Or m aybe there is something better for this ?

Thanks!

25th July, 2017

mstdmstd started a new conversation To Logg All Sql-statements With Error • 3 months ago

Hello, In laravel 5.4 adding lines in app/Providers/AppServiceProvider.php file:

public function boot()
{

    if ($this->app->environment('local')) {
        \DB::listen(function($query) {
            $dbLog = new \Monolog\Logger('Query');
            $dbLog->pushHandler(new \Monolog\Handler\RotatingFileHandler(storage_path('logs/Query.log'), 5, \Monolog\Logger::DEBUG));
            $dbLog->info($query->sql, ['Bindings' => $query->bindings, 'Time' => $query->time]);
        });
    }
...    

I made log of all successfull sql in file.

If there is a way to catch and write to this file all sql with errors and errior description?

I know about laravel.log, but I would prefer to write all sql-statements successfull and with error.

Thanks!

21st July, 2017

mstdmstd started a new conversation I Want To Add Some Functionality Into Laravel-debugbar Extention • 4 months ago

Hello,

In laravel 5.4 using laravel-debugbar extention https://github.com/barryvdh/laravel-debugbar I would like to add some more features to it : In “Queries” tab near with sql statement to add 2 buttons:

  1. Copy sql-statement to the clipboard.
  2. Copy sql-statement to the clipboard nicely formatted.

As I see docs it has no such functionality.

I suppose I need to edit it mannually, but I would like to know: a)If this extension has some events, which could be usefull for me? b) If I edit this extention, which could be good way not to lose my modifications in next system update?

Thanks!

2nd July, 2017

mstdmstd started a new conversation How Install My Local Laravel 5.4 Application On AWS/ubuntu 16 Hosting? • 4 months ago

Hello,

I need to install my local Laravel 5.4 application from my local server(kubuntu 16) on my AWS hosting, based on ubuntu 16.

Have I to do it in the same way, as I did on my local comp: add line like 127.0.0.3 local-project.com in etc/hosts : and running command like a2ensite local-project.com.conf in /etc/apache2/sites-available directory?

What else have I to pay attention at?

If there is some detailed instruction for this?

24th June, 2017

mstdmstd started a new conversation How Get Twig_Environment With TwigBridge Extention • 4 months ago

Hello, I found this article http://kaltencoder.com/2015/07/create-twigbridge-functions-and-filters/ usefull to use twig in my Laravel 5.4.25 with TwigBridge extention. What I did not find how to get access to Twig_Environment , as I need to show twig version in my system info. In my ci app I did like : $twig_Environment = $this->twig->getTwig(); $twig_Environment->addGlobal( 'TWIG_VERSION',Twig_Environment::VERSION );

And which is the way to declare global vars with this extention?

Thanks!

8th June, 2017

mstdmstd started a new conversation How Check If Some Package Installed • 5 months ago

Hello, Which is the best way in laravel 5.4 to check if some package (like Debugbar or other) is installed ?

Thanks!

30th May, 2017

mstdmstd started a new conversation Is It Possible To Edit App/Mail Templates In Some Rtf-editor • 5 months ago

Hello, Now in laravel 5.4 I work with mail. It is cool. The question is : as email patterns are saved in app/Mail directory, if there is a way to give for admins of site to edit these templates in some rtf-editor(like tinyMCE)? Some time ago I did similar editors and code of these templates was saved in db and rendering these emails I substituted the variables... If there are some tools/plugings for this?

Thanks!

23rd May, 2017

mstdmstd left a reply on To Make Tracing Log Of All Sql Statements • 5 months ago

That is good, but I see sql-statements without binding variables, like

[code]select * from "pd_settings" where "name" = ? {"Bindings":["site_name"],"Time":9.47}

Is there is a way to show sql-statements with parameters ?

18th May, 2017

mstdmstd started a new conversation To Make Tracing Log Of All Sql Statements • 6 months ago

Hi,
If there is a way in laravel 5.4 to make tracing log of all sql statements?
I mean Barryvdh\Debugbar iis usefull, but sometimes I would like more, say if form is submitted and is redirected to other page or ajax request,
tracing in Barryvdh\Debugbar of submitting is lost.

If there is similar tool?

Thanks!

14th May, 2017

mstdmstd started a new conversation Where Auth.login View Is Called From • 6 months ago

    Hello,
    Auth module use resources/views/auth/login.blade.php template,
    but in app/Http/Controllers/Auth/LoginController.php file I did not find where this template is called?
    I mean line like 
    

    return view('auth.login', $dataArray );
    

    as I need to add more variables to login view.
    
        Thanks!

13th May, 2017

mstdmstd left a reply on To Fire Event When User Failed To Login • 6 months ago

Thank you for your hints! I created event and run it as :

        protected function sendFailedLoginResponse()
        {
            $request = request();
    
            $loginCreditialsArray= ['email' => $request->input('email'), 'password' => $request->input('password')];
            $retArray = \Event::fire(new backendFailOnLogin($loginCreditialsArray));
        ...

    
    But In event definition I found that only constructor is triggered with given parameters:


    <?php
    
    namespace App\Events;
    use Illuminate\Broadcasting\Channel;
    ...
    class backendFailOnLogin
    {
        use Dispatchable, InteractsWithSockets, SerializesModels;
    
        public function __construct(array $loginCreditialsArray)
        {
            if ( !empty($loginCreditialsArray['email']) and !empty($loginCreditialsArray['password'])  ) {
            ...


    Actually In .env file I have parameters for default login and create this admin programmatically if it is not created yet
    and his creditials entered. I doubt if constructor is proper place for this?
     

11th May, 2017

mstdmstd left a reply on To Fire Event When User Failed To Login • 6 months ago

    Thank you for responce, but I did not which file did you mean...
    I searched in my project and found file vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastController.php with similar code of you example :
    <?php
    
    namespace Illuminate\Broadcasting; 
    
    use Illuminate\Http\Request;
    use Illuminate\Routing\Controller;
    use Illuminate\Support\Facades\Broadcast;
    
    class BroadcastController extends Controller
    {
        /**
         * Authenticate the request for channel access.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return \Illuminate\Http\Response
         */
        public function authenticate(Request $request)
        {
            return Broadcast::auth($request);
        }
    }
     
    But I am not sure is it a proper place in vendor/laravel/framework where I need to copy this file ? Must it be inside of my project ?
    
    I have app/Http/Controllers/Auth/LoginController.php file, but is it ?
    
    ======
    Hello, 
    In laravel 5.4 I need to fire event and make actions when user failed to login into my system (with Auth module).
    Could ypu please give hint(or ref to example) how to make it?
    
    Thanks!

9th May, 2017

mstdmstd started a new conversation To Fire Event When User Failed To Login • 6 months ago

Hello, In laravel 5.4 I need to fire event and make actions when user failed to login into my system (with Auth module).

Could you please give hint(or ref to example) how to make it?

Thanks!

6th May, 2017

mstdmstd left a reply on How Include In Project Scss File • 6 months ago

    Sorry, but I need for some clarifications:
    1) In file resources/assets/sass/app.scss I added line :
    @import "my_app.scss";
            
    which is located in the same directory(but that could be path) with scss definitions.
            
    2) I have no any files in node_modules dir. I am not sure what do you call as "if your file is"?
    In which file I have to add line 
    @import "my_app.sass"
            
    to add style definitions from it to my site?
            
    Thanks!

5th May, 2017

mstdmstd left a reply on How Include In Project Scss File • 6 months ago

    I have errors submitting my response.
    Please look at this
    https://pastebin.com/zmB8YAKE
    Thank you!

4th May, 2017

mstdmstd started a new conversation How Include In Project Scss File • 6 months ago

hello, In laravel 5.4 I want to make using of include in project scss file and converting them into css files I googled for some docs how to do it and do :

    # lsb_release -d; uname -r; uname -i
    Description:    Ubuntu 16.04.2 LTS
    4.4.0-62-generic
    x86_64
    # npm -v
    4.2.0
    # node -v
    v7.9.0
    
    # npm install
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
    npm WARN [email protected] requires a peer of [email protected]^4.0.0 but none was installed.
    
    I do not know if warnings above are critical and if there is a sense to continue and how top fix it?

    Next :
    
    # npm run dev

with output with errors: https://pastebin.com/AL52A5YR

and a lot of errors...

2) In my prior php/scss app I run in console :
sass --watch  static/scss/default/admin/style.scss:static/css/default/admin/style.css

and it worked ok for me...
I tried to make silmilar:
# sass --watch  resources/assets/sass/app.scss : public/css/app.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
  error No such file or directory @ rb_sysopen - 
Errno::ENOENT: No such file or directory @ rb_sysopen - 
  Use --trace for backtrace.


I have file resources/assets/sass/app.scss with content:

// Fonts
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);

// Variables
@import "variables";

// Bootstrap
//@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";


.title_message {
  color: red;
  background-color: crimson;
}
.a_link {
  cursor: pointer;
  background-color: red;
}
.box-title {
  color: navy;
  border: 2px dotted green;
}
.table_info {
  font-size: smaller;
  border: 1px red;
}




Which is the good way of adding scss file to project ?

  Thanks!
Edit Your Profile
Update

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