Add Public to asset path in Laravel

 I want to install laravel in shared hosting and I followed the steps here https://stackoverflow.com/a/28449523 but my asset path doesn't include the public directory

Instead of this

<link href='http://example.com/public/assets/css/style.css' type='text/css' media='all' />

I'm getting this

<link href='http://example.com/assets/css/style.css' type='text/css' media='all' />

How do I change the directory of the asset folder(add public to assets) without changing any core classes?


Add ASSET_URL=public in your .env file and run php artisan config:cache

Livewire 3 Customizing the asset URL / Livewire3 is not working without PHP artisan serve

 

You can try reference the livewire assests from AppServiceProvider.php

use Illuminate\Support\ServiceProvider;
 

use Livewire\Livewire;

use Illuminate\Support\Facades\Route;


 

class AppServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        Livewire::setScriptRoute(function ($handle) {
            return Route::get('/example-app/livewire/livewire.js', $handle);
        });

        Livewire::setUpdateRoute(function ($handle) {
            return Route::post('/example-app/livewire/update', $handle);
        });


    }
}


Livewire is not working without PHP artisan serve

 

First of all you should publish livewire configurational file with next command:

php artisan livewire:publish --config


Then in config folder you would be able to find file htdocs\YourProjectName\config\livewire.php where you would be able to edit the next string:

'asset_url'  => null,

to

'asset_url'  => 'http://localhost/YourProjectName/public',
 

And it should work after that. At least it worked in my case.

Docs: https://laravel-livewire.com/docs/2.x/installation

But in docs that string is called:

'asset_base_url' => '/assets'

instead of

'asset_url'  => 'http://localhost/YourProjectName/public',

But in the end it doesn't matter;)

 

https://stackoverflow.com/questions/65370458/livewire-is-not-working-without-php-artisan-serve

https://github.com/livewire/livewire/issues/84


How to sortBy and paginate from Json Table

 

// 1 here we will create collection from querybuilder using get methode
// 2 we will use sortBy or sortByDesc methode for ordering the collection
// 3 crete manual paginator 
 
$myQueryPagination = $query->get()
->sortByDesc(
function ($mySortByJson) {
$myQueryPagination = isset(json_decode($mySortByJson->datadaftarpolirj_json, true)['eresep']) ? 1 : 0;
return ($myQueryPagination . $mySortByJson->rj_date1);
}
);


$myQueryPagination = $this->paginate($myQueryPagination, $this->limitPerPage);
 
 

create manual paginator

Manual pagination from array collection

Here, we will create PaginationController with two method, one for call route and another for creating custom pagination. So let's add controller as like bellow:

 

 Create controller

<?php

 

namespace App\Http\Controllers;

 

use Illuminate\Http\Request;

use Illuminate\Pagination\Paginator;

use Illuminate\Support\Collection;

use Illuminate\Pagination\LengthAwarePaginator;


 

class PaginationController extends Controller

{

    /**

     * The attributes that are mass assignable.

     *

     * @var array

     */

    public function index()

    {

        $myArray = [

            ['id'=>1, 'title'=>'Laravel CRUD'],

            ['id'=>2, 'title'=>'Laravel Ajax CRUD'],

            ['id'=>3, 'title'=>'Laravel CORS Middleware'],

            ['id'=>4, 'title'=>'Laravel Autocomplete'],

            ['id'=>5, 'title'=>'Laravel Image Upload'],

            ['id'=>6, 'title'=>'Laravel Ajax Request'],

            ['id'=>7, 'title'=>'Laravel Multiple Image Upload'],

            ['id'=>8, 'title'=>'Laravel Ckeditor'],

            ['id'=>9, 'title'=>'Laravel Rest API'],

            ['id'=>10, 'title'=>'Laravel Pagination'],

        ];

 

        $data = $this->paginate($myArray);

   

        return view('paginate', compact('data'));

    }

   

    /**

     * The attributes that are mass assignable.

     *

     * @var array

     */

    public function paginate($items, $perPage = 5, $page = null, $options = [])

    {

        $page = $page ?: (Paginator::resolveCurrentPage() ?: 1);

        $items = $items instanceof Collection ? $items : Collection::make($items);

        return new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(), $perPage, $page, $options);

    }

}

 Create View File



Here, we just need to create blade file to print data. so let's create simple blade file as like bellow:

app/Http/Controllers/PaginationController.php

Read Also: How to Define Fallback Routes in Laravel?

<div class="container">

    <table class="table table-bordered">

        <tr>

            <th>Id</th>

            <th>Title</th>

        </tr>

        @foreach($data as $post)

        <tr>

            <td>{{ $post->id }}</td>

            <td>{{ $post->title }}</td>

        </tr>

        @endforeach

    </table>

</div>

   

{{ $data->links() }}

Now you can run and check.

 

 https://www.itsolutionstuff.com/post/how-to-create-pagination-from-array-in-laravelexample.html

RESIZE REDO LOG ORACLE 10

 


--MELIHAT REDO LOG FILE

select * from V$LOGFILE a, V$LOG b where a.GROUP# = b.GROUP#



--MENAMBAH REDO LOG FILE

ALTER DATABASE ADD LOGFILE ('/opt/oracle/oradata/orcl/redo04.log') SIZE 524288000;

ALTER DATABASE ADD LOGFILE ('/opt/oracle/oradata/orcl/redo05.log') SIZE 524288000;

ALTER DATABASE ADD LOGFILE ('/opt/oracle/oradata/orcl/redo06.log') SIZE 524288000;




--MENGHAPUS REDO LOG FILE

--REDO LOG HANYA DAPAT DI HAPUS KETIKA STATUS INACTIVE // LAKUKAN SWITCH DAN CHECKPOINT

ALTER DATABASE drop LOGFILE GROUP 1;

ALTER DATABASE drop LOGFILE GROUP 2;

ALTER DATABASE drop LOGFILE GROUP 3;


--MEMINDAH REDOLOG FILE

ALTER SYSTEM SWITCH LOGFILE;


--CEKPOIN REDOLOG FILE

alter system checkpoint;

 

 

https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/managing-the-redo-log.html#GUID-6A7FB6CB-AF29-40BC-BDB3-B514C502B2F6

 

https://support.oracle.com/knowledge/Oracle%20Database%20Products/1928361_1.html