skip to Main Content

Laravel – How to release only API routes

I developed a web application with React frontend and Laravel for stateless API. I would like to access to the frontend with the url "http://localhost/my-application" and the backend's API with the url "http://localhost/api/my-application/". I created the folder "www/api/my-application" and here…

VIEW QUESTION

Queation related to DataTables in laravel

i have the following code of backend $datatable->addColumn('product_quantity', function () { $quantities = TransactionSellLine::pluck('quantity')->all(); return $quantities; }); and I have the following code of frontend columns: [ { data: 'product', name: 'product' }, { data: 'product_quantity', "searchable": false, render: function…

VIEW QUESTION

Laravel7 query wrap with "not"

How to create "NOT" wrapped criteria, ie: WHERE id=1 AND NOT (tag='foo' OR tag='bar') I know I can wrap with closure $q->where('id', 1) ->where(function ($iq) { $iq->where('tag', 'foo') ->orWhere('tag', 'bar'); }); Something like this (which does not work): $q->where('id', 1)…

VIEW QUESTION

Laravel – SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `companies`)

I have entered all values ​​into files .env and database.php properly but I get this error: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from companies) This is file data .env APP_NAME=Laravel APP_ENV=local APP_KEY=base64:my key APP_DEBUG=true APP_URL=http://localhost LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql…

VIEW QUESTION
Back To Top
Search