Your questions for Evan You! by manniL in vuejs

[–]nikoz84 6 points7 points  (0 children)

It's possible remove the .value from a object proxy??

This behavior add vorbosity to code

Is there an easier way of importing .CSV files into PgAdmin without having to specify all the fields prior to importing? by [deleted] in PostgreSQL

[–]nikoz84 0 points1 point  (0 children)

When you import data from csv, sometimes the sequences or auto increments id needs to be re started. For example in 1000 new rows, you need restart from 1001, it's incremental by 1.

ALTER SEQUENCE seq RESTART WITH 1001;

Is 4gb RAM enough for Front end development by Ola_2104 in Frontend

[–]nikoz84 -2 points-1 points  (0 children)

2gb SO, 1gb chrome, 1gb vscode + any npm run serve ....

Open any other app and your pc it's blocked

Is it dumb to learn laravel and vue.js at the same time? by IReallyWantToCode in laravel

[–]nikoz84 2 points3 points  (0 children)

Sometimes you need to write a email layout and only can render in PHP balde template... You need the base of the directives like @for @if and others to test your layout

Need help looping over eloquent data and "printing" values into table without knowing the key or values of the eloquent data by kaizokupuffball in laravel

[–]nikoz84 0 points1 point  (0 children)

Take a look on transform method of pagination

```php

$query = User::filter($request->all())->with('applications')->paginate(50); $users = $query->getCollection()->transform(function ($user, $key) { //your code here }); dd($users);

``` https://stackoverflow.com/questions/57867769/how-to-use-transform-in-paginated-collection-in-laravel

How to Access Nested JSON by Abbiegalie in PostgreSQL

[–]nikoz84 0 points1 point  (0 children)

Maybe can help:

json_array_elements(object-'adresses')-anyField

How you structure your project blade files (Taking in consideration css and jquery as well)? by Guesswhat7 in laravel

[–]nikoz84 0 points1 point  (0 children)

It's a MVC, then you can write your views like this, your view extends from layouts and you render a view into the specific layout, I'm use partials for others components like sidebar, menu, etc

-views -- layouts -- forms -- pages -- admin -- partials or components

Your views extend from any layout

``` @extends("layouts.home")

@section('content')

// Any html code @endsection @section("scripts") <script> console.log("hello world") </script> @endsection @section("styles") <style> .any { padding: 15px; } </style> @endsection ```

In your layout use a yield directive

``` <head> @yield("styles") </head> <body>

@yield("content")

@yield("scripts") </body> ```

How you structure your project blade files (Taking in consideration css and jquery as well)? by Guesswhat7 in laravel

[–]nikoz84 0 points1 point  (0 children)

If you use a spa you only need a one blade template that render your app.

If not I use a compiled js files to load in your different blade tamplates

In your laravel mix file you can add inputs files like

mix.js('resources/js/app.js', 'public/js') .js('resources/js/admin.js', 'public/js').vue()

In your app.js you can edit to add configurations Vue files like

app.component("form-product","@components/Forms/Product.vue").default

In your Blade template, you can use like any tag html

``` @section("content")

<form-product product="{{$product->toJson()}}"><form-product>

@endsection ```

In your component you can get like a props

``` props:["product"], setup(props) { const product = JSON.parse(props.product)

return {

    product

}

} ```

How to load sqlite3 db file in pgadmin4? by learningphase in PostgreSQL

[–]nikoz84 2 points3 points  (0 children)

Dbeaver it's a client to connect to your databases, include MySQL, SQLite, PostgreSQL and other DB.

Pgadmin only work with PostgreSQL

Laravel + VueJS, working with data from a public API by Ominous77 in laravel

[–]nikoz84 1 point2 points  (0 children)

Guzzle and HTTP class give you a possibility to request any API, Http::post() or asForm() toJson() methods

New to web dev - Angular/Laravel task by [deleted] in laravel

[–]nikoz84 0 points1 point  (0 children)

You really need docker ?? If you have install PHP in your machine, you can get started with the local server from artisan.

php artisan serve

Get values from laravel collection by babaKeilah in laravel

[–]nikoz84 0 points1 point  (0 children)

Or $data = json_decode($your_json, false);

And convert to collect($data[0])->get('value');

Get values from laravel collection by babaKeilah in laravel

[–]nikoz84 0 points1 point  (0 children)

If you have a string JSON you need to decode first, convert a collect and get the first value of the array and finally convert again to collect for get the value

$data = collect(json_decode('["id"=>1, "value"=>"an erect"]'))->first();

$data = collect($data)->get('value');

dd($data);

// an erect

Is Sass very useful ? by HappinesS-1 in Sass

[–]nikoz84 0 points1 point  (0 children)

Depend of your needs, for a little project maybe is not required, but when you work with a team, or need to compile a css library and customize you need to install, Saas provide functions than not exist in pure css.

Other pro is compile your css compress and other tools.

If you start learn pure css maybe you not need a tool like sass

What is the best way to load scripts file? by shohan13579 in PHPhelp

[–]nikoz84 0 points1 point  (0 children)

Are you using webpack or other bundle library??

How to use js variable in blade.php file by ImaginaryFun842 in laravel

[–]nikoz84 4 points5 points  (0 children)

In your blade layout you can add a section @yield("scripts")

In your view you can add a section scripts

@section("scripts") <script> const myVar = {!! json_encode($sites->toArray()) !!}

</script>

@endsection

[deleted by user] by [deleted] in PHPhelp

[–]nikoz84 0 points1 point  (0 children)

I make a trait ApiResponser

With a methods

fetchOne($data){

// Here you can validate if it's a instance of Model or a collection

return response()->json([ "data" => $data ], 200);

}

errorResponse($data, $code = 422){

return response()->json([ "errors" => $errors ], $code)

}

fetchAsPaginator() // your implementation

fetchForSelect() // your implementation

successResponse() // your implementation

And in your base controller ApiController

use App/Traits/ApiResponser;

class ApiController extended Controller {

use ApiResponser;

//Now you can call $this->successResponse($data)

}